Skip to content

Instantly share code, notes, and snippets.

@ogabrielguerra
Created May 25, 2019 00:07
Show Gist options
  • Save ogabrielguerra/47734d1c6936f292ca30b9e7d2ca6ad4 to your computer and use it in GitHub Desktop.
Save ogabrielguerra/47734d1c6936f292ca30b9e7d2ca6ad4 to your computer and use it in GitHub Desktop.
REACT | Compose a new object from Component State
const states = this.state.proposalOptions;
let gathered = {};
Object.keys(states).map((key)=>{
gathered[key] = this.state.proposalOptions[key];
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment