@jdthornton/usecallbackref
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @jdthornton/usecallbackref

Weekly Downloads

17

Version

1.0.2

License

MIT

Unpacked Size

2.81 kB

Total Files

5

Last publish

Collaborators

  • jdthornton