Grokking React Native
Vote

0% completed

​

Debugging and Performance Optimization

A reducer changed a user's name, the store held the new name, and the screen still showed the old one. This is the reducer:

const profileReducer = (state = { user: { name: 'A' } }, action) => { if (action.type === 'rename') { state.user.name = action.payload; return state; } return state; };
Store after dispatch: B Renders caused by the action: 0 Text on the screen: A

That output comes from a store with one development check turned off, using `getDefaultMiddleware({ immutableCheck: false })

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content