Created
April 11, 2017 12:17
-
-
Save ar5had/128a5c51b3258908365e99300c430130 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// state = { len: 2, arr: [1,2] }; | |
const newState = Object.assign({}, state); | |
// for simplicity sake | |
newState.arr = [3, 4]; | |
this.setState({state: newState}); | |
// or | |
this.props.actions.changeState(newState); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment