1.0.2 • Published 2 years ago
@jdthornton/usecallbackref v1.0.2
@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!"