Skip to content

adrserr/simple-react-hooks

Repository files navigation

simple-react-hooks

React hooks library. Simple, yet powerful custom hooks

Install

npm i simple-react-hooks

Hooks

  • usePrevious — return previous prop or state.
  • useStateWithCallback — return a state and a setter. Callback could be passed and it would be executed after each update.
  • useStateWithCallbackSync — same as useStateWithCallback, but synchronously.
  • useWatch — on each update a console.log or a custom fn would be executed.
  • useForceUpdate — force a component to re-render.
  • useTimeout — start a timeout that will fire a callback, you could stop it or restart.
  • useInterval — start an interval that will fire a callback each time delay finish, it could be restarted or stopped.

Contributing

Feel free to open a PR, or suggest any improvements or new hooks.

Author

Adrián Serrano

Contact

[email protected]

About

Custom React Hooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •