Skip to content

Instantly share code, notes, and snippets.

@ar5had
Created April 11, 2017 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ar5had/128a5c51b3258908365e99300c430130 to your computer and use it in GitHub Desktop.
Save ar5had/128a5c51b3258908365e99300c430130 to your computer and use it in GitHub Desktop.
// 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