react-hooked

0.1.1 • Public • Published

react-hooked

♻️ Useful custom hooks for react.

Available Hooks

usePrevious

Lets you reference the previous prop or state of a component:

function Counter() {
  const [count, setCount] = useState(0);
  const prevCount = usePrevious(count);
 
  return (
    <h1>
      Now: {count}, before: {prevCount}
    </h1>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-hooked

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

245 kB

Total Files

9

Last publish

Collaborators

  • vitorbal