@ayonli/react-hooks
v0.1.3
Published
A group of react hooks that makes life easier.
Downloads
224
Readme
React Hooks
A group of react hooks that makes life easier.
This package currently include the following hooks, more hooks may be added in the future.
- useAsyncData Asynchronously load remote data, usually used with {@link fetch} API.
- useDebouncedCallback Returns a debounced function that can be used to reduce unnecessary calls.
- usePropState Uses a prop as the state in a component, and when the prop changes, the state will change accordingly.
- useRerender Returns a rerender function that can be used to trigger a rerender of the component manually.
- useRevertibleState
Adds additional functions to the
useState
hook, allowing us to undo and redo state changes. - useRouter Manipulates route and retrieving route parameters.
- useSubmit Submit data to a remote server and track the status of the request.
- useUrlState Similar to
useState
, but persist the state to the URL query parameters.