How to Log Draft State Values
Discover how to accurately log draft state values in Redux Toolkit slice reducers using the current utility function. Understand why direct logging might mislead due to Immer's Proxy and how to overcome it for better debugging in your Twitter search app.
We'll cover the following...
We'll cover the following...
Logging state values may seem like a trivial task that shouldn’t make it into a course. What could be difficult about placing a console.log within a reducer created via createSlice?
Well, we’ll arrive at an easier answer by just going on to add a console.log!
The problem with console.log
Whenever we fetch new tweets, log the current state before and after we set the isLoading ...