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