Store and access a value from the previous render
const [ active, setActive ] = useState(false) const previouslyActive = usePrevious(active)