@jdthornton/usecallbackref
v1.0.2
Published
React callback ref hook
Downloads
59
Readme
@jdthornton/usecallbackref
React callback ref hook.
Install
$ npm install @jdthornton/usecallbackref
Usage
import useCallbackRef from "@jdthornton/usecallbackref";
function App(){
const ref = useCallbackRef(() => {
console.log("It's a reference!")
})
useEffect(() => {
ref.current();
},[ref]);
return null
}
//=> "It's a reference!"