A layer over useEffect that provides previous values of dependencies.
npm install use-effect-with-previous> A layer over useEffect that provides previous values of dependencies.

``bash`
npm install --save use-effect-with-previous
`js
import useEffectWithPrevious from 'use-effect-with-previous'
const Example = () => {
const [ state, setState ] = useState(1);
const [ anotherState, setAnotherState ] = useState(2);
useEffectWithPrevious(
([ previousState, previousAnotherState ]) => {
// Compare previous and current state.
},
[state, anotherState]
);
}
``
MIT © juangabrieldev
---
This hook is created using create-react-hook.