cust-hooks-use-previous

1.0.2 • Public • Published

About

cust-hooks-use-previous gives you the previous value of state in functional component / React hook.

Installation

npm i cust-hooks-use-previous

Importing the hook

import { usePrevious } from 'cust-hooks-use-previous';

#Usage

const funFunction =() => { const prevNav = usePrevious(activeNav); const prevSortBy = usePrevious(sortBy); // prevNav will be previous value of activeNav. }

Package Sidebar

Install

npm i cust-hooks-use-previous

Weekly Downloads

3

Version

1.0.2

License

ISC

Unpacked Size

1.74 kB

Total Files

4

Last publish

Collaborators

  • kartikshah