mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
1.8 KiB
JSON
1 line
1.8 KiB
JSON
{"ast":null,"code":"import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","map":{"version":3,"sources":["/app/node_modules/@material-ui/core/esm/utils/useForkRef.js"],"names":["React","setRef","useForkRef","refA","refB","useMemo","refValue"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,eAAe,SAASC,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgC;AAC7C;AACF;AACA;AACA;AACA;AACE,SAAOJ,KAAK,CAACK,OAAN,CAAc,YAAY;AAC/B,QAAIF,IAAI,IAAI,IAAR,IAAgBC,IAAI,IAAI,IAA5B,EAAkC;AAChC,aAAO,IAAP;AACD;;AAED,WAAO,UAAUE,QAAV,EAAoB;AACzBL,MAAAA,MAAM,CAACE,IAAD,EAAOG,QAAP,CAAN;AACAL,MAAAA,MAAM,CAACG,IAAD,EAAOE,QAAP,CAAN;AACD,KAHD;AAID,GATM,EASJ,CAACH,IAAD,EAAOC,IAAP,CATI,CAAP;AAUD","sourcesContent":["import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}"]},"metadata":{},"sourceType":"module"} |