Myvideo

Guest

Login

How to Track Old State vs New State in React with useRef

Uploaded By: Myvideo
1 view
0
0 votes
0

In this lesson we'll learn how to compare the differences between a value's “old state“ vs its “new state“ inside of React. This is often important when you want to make a decision on what to do if the value has changed (and you need to see what that value was BEFORE it changed). With the standard useEffect hook in react this isn't possible, but we can make it possible by adding in a useRef hook, so let's dive into it! Other Important Links: --------------------------- Check out our Bootcamp: Assignment Submission App Code: Subscribe to the Channel: #react #code #learntocode #springboot #bootstrap

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later