Skip to content

jdthornton/usecallbackref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@jdthornton/usecallbackref

npm (scoped) npm bundle size (minified)

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!"

About

React callback ref hook

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published