BFE.dev
React Coding Questions5. usePrevious()

5. usePrevious()

ReactHooks
Share

  - accepted / - tried

Create a hook usePrevious() to return the previous value, with initial previous value of undefined.

prevnext

Bugfree ordinary solution is better than buggy fancy ones.

SolutionAIPosts(147)

Try it out

Console