Skip to content

Latest commit

 

History

History

usePrevious

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

usePrevious

Returns the previous value of the provided value.

Usage

const Usage = () => {
  const [count, setCount] = useState(0);

  const prevCount = usePrevious(count);

  ...
};