-
v1.4.1 Stable
released this
2023-07-26 12:16:40 +03:00 | 47 commits to main since this releaseIn this release, we're excited to introduce a new functionality - the usePrevious hook. This hook allows you to easily retain and utilize the previous value of a state variable.
Additions
usePrevious hook: Provides a way to get the previous value of a state variable. This can be handy in cases where the current value of a variable needs to be compared to its previous value.
Usage
import usePrevious from 'react-hook-kit'; const YourComponent = () => { const [count, setCount] = React.useState(0); const prevCount = usePrevious(count); //... your logic }In the example above, prevCount will always contain the previous value of count.
Special thanks to SynDevUI for their contributions to this release.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
-
Source code (ZIP)