• v1.4.1 f32eb01b04

    v1.4.1 Stable

    CosmicCoder-sudo released this 2023-07-26 12:16:40 +03:00 | 47 commits to main since this release

    In 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