Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
13
node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
generated
vendored
Normal file
13
node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
||||
import * as React from "react";
|
||||
function useCallbackRef(callback) {
|
||||
const callbackRef = React.useRef(callback);
|
||||
React.useEffect(() => {
|
||||
callbackRef.current = callback;
|
||||
});
|
||||
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
||||
}
|
||||
export {
|
||||
useCallbackRef
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue