usePrevious
Allows access to the previous value in state.
Import#
import { usePrevious } from 'primereact/hooks';
Basic#
Previous value remains one step behind the current value while input is being typed.
const [value, setValue] = useState('');
const prevValue = usePrevious(value);