August 2017
Beginner
374 pages
10h 41m
English
When you define a new variable from an object, it does not create a new object--it only creates another reference to the same object.
Consider the following example:
const brokenReducer = (state, action) = { let posts = state.posts posts[action.id].text = action.text return { ...state, posts }}
The preceding highlighted line directly modifies the existing state object. Do not do this.
Read now
Unlock full access