You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
2.8 KiB
1 line
2.8 KiB
{"ast":null,"code":"import invariant from 'invariant';\nimport { useCallback } from 'react';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nexport default function useWrappedRefWithWarning(ref, componentName) {\n // @ts-ignore\n if (!(process.env.NODE_ENV !== \"production\")) return ref; // eslint-disable-next-line react-hooks/rules-of-hooks\n\n const warningRef = useCallback(refValue => {\n !(refValue == null || !refValue.isReactComponent) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${componentName} injected a ref to a provided \\`as\\` component that resolved to a component instance instead of a DOM element. ` + 'Use `React.forwardRef` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element') : invariant(false) : void 0;\n }, [componentName]); // eslint-disable-next-line react-hooks/rules-of-hooks\n\n return useMergedRefs(warningRef, ref);\n}","map":{"version":3,"names":["invariant","useCallback","useMergedRefs","useWrappedRefWithWarning","ref","componentName","process","env","NODE_ENV","warningRef","refValue","isReactComponent"],"sources":["C:/Cours/SAE/SAE-3.01/Scripted/Scripted/website/node_modules/react-bootstrap/esm/useWrappedRefWithWarning.js"],"sourcesContent":["import invariant from 'invariant';\nimport { useCallback } from 'react';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nexport default function useWrappedRefWithWarning(ref, componentName) {\n // @ts-ignore\n if (!(process.env.NODE_ENV !== \"production\")) return ref; // eslint-disable-next-line react-hooks/rules-of-hooks\n\n const warningRef = useCallback(refValue => {\n !(refValue == null || !refValue.isReactComponent) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${componentName} injected a ref to a provided \\`as\\` component that resolved to a component instance instead of a DOM element. ` + 'Use `React.forwardRef` to provide the injected ref to the class component as a prop in order to pass it directly to a DOM element') : invariant(false) : void 0;\n }, [componentName]); // eslint-disable-next-line react-hooks/rules-of-hooks\n\n return useMergedRefs(warningRef, ref);\n}"],"mappings":"AAAA,OAAOA,SAAS,MAAM,WAAW;AACjC,SAASC,WAAW,QAAQ,OAAO;AACnC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,eAAe,SAASC,wBAAwB,CAACC,GAAG,EAAEC,aAAa,EAAE;EACnE;EACA,IAAI,EAAEC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,CAAC,EAAE,OAAOJ,GAAG,CAAC,CAAC;;EAE1D,MAAMK,UAAU,GAAGR,WAAW,CAACS,QAAQ,IAAI;IACzC,EAAEA,QAAQ,IAAI,IAAI,IAAI,CAACA,QAAQ,CAACC,gBAAgB,CAAC,GAAGL,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGR,SAAS,CAAC,KAAK,EAAG,GAAEK,aAAc,iHAAgH,GAAG,mIAAmI,CAAC,GAAGL,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;EACnZ,CAAC,EAAE,CAACK,aAAa,CAAC,CAAC,CAAC,CAAC;;EAErB,OAAOH,aAAa,CAACO,UAAU,EAAEL,GAAG,CAAC;AACvC"},"metadata":{},"sourceType":"module"} |