1.2.0 • Published 5 years ago
@billogram/use-previous v1.2.0
@billogram/use-previous
A React hook for storing previous values
Install
yarn add @billogram/use-previousUsage
import usePrevious from '@billogram/use-previous';usePrevious
const [value, setValue] = React.useState(0);
const previousValue = usePrevious(value, 0);Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT