react-use-lifecycle-helpers
Helpers functions arround useEffect hook to make your life easier, providing the most use cases of useEffect hook, among them the lifecycle of class component.
Install
npm install --save react-use-lifecycle-helpers
Usage
useDidMount
This hook is a replacement for the componentDidMount
method.
; { const useDidMount = ; ;}
useDidUpdate
This hook is similar to the componentDidUpdate
method.
; { const state setState = ; const useDidUpdate = ; ;}
useWillUnmount
A hook that's a replacement for the componentWillUnmount
method.
; { const useWillUnmount = ; ;}
useDepsDidChange
Track multiple or one of the state properties.
; { const state setState = ; const useDepsDidChange = ; ; ; ;}
License
MIT © Mohcine NAZRHAN
Contributors
Todo
- Migrate to TypeScript