- accepted / - tried
Create a hook usePrevious() to return the previous value, with initial previous value of undefined.
usePrevious()
undefined
Think aloud!
Try it out
Console