1.0.6 • Published 4 years ago
react-more-hooks v1.0.6
React More Hooks
React More Hooks is a library for help you in react's projects.
Installation
npm install react-more-hooksOr, you can use Yarn
yarn add react-more-hooksList of hooks
| Name | Arguments | Returns | Description |
|---|---|---|---|
| useUnmounted | func: React.EffectCallback | void | Run the callback when the component is unmounted |
| useDidMountEffect | Same then useEffect | void | Run the callback only if a prop change. Not run in first render |
| usePeristedState | key:string | Same then useState | A usestate where the initial value comes from local storage |
| useStateCallback | initialState: any, callback: Function | Same then useState | A usestate where a callback is call when state change |
| useIsMounted | none | () => boolean | Check if component is mount |
| useForceUpdate | none | void | Force a rerender |
| useScreenSize | none | {width: number, height:number } | Get screen size |
List of contexts
| Name | Description |
|---|---|
| Remount | Remount the children |