@bambooapp/react-hooks
v1.0.8
Published
A easy to use, fully type-safe, react hooks library to easy your day to day react development.
Downloads
14
Keywords
Readme
React Hooks
A easy to use, fully type-safe, react hooks library to easy your day to day react development.
Installation
Use a bundler of your choice to import the library.
eg: yarn add @bambooapp/react-hooks
Ref Hooks
- useLatest Use the most recent value of the argument, but as a ref.
- usePrevious Use the last value of the argument, returns a ref
- useMergeRefs Use this hook to merge different refs, legacyRefs or RefCallbacks into one. The reference of the returned value never changes.
Callback Hooks
- useSafeCallback Use a safe callback, the reference function never changes, yet always has access to the most recent state. Write your code without worrying about writing a single useCallback.
Detective mode on
- useWhatHasUpdated Use a hook to investigate what has changed. It will log to the console if the value of the object changes.