usePrevious Tracks the value of the given argument from a previous render and returns it. Example const [state, setState] = useState(); const previousState = usePrevious();