Skip to content

Commit

Permalink
[fixed] use Object.assign for now.
Browse files Browse the repository at this point in the history
While the don't move to v2, we can use Object.assign
and later use the spread operator.
  • Loading branch information
diasbruno committed Jun 8, 2017
1 parent 39cec6f commit 99c7e32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/basic/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ var App = React.createClass({
},

openModal: function() {
this.setState({ ...this.state, modalIsOpen: true });
this.setState(Object.assign({}, this.state, { modalIsOpen: true }));
},

closeModal: function() {
this.setState({ ...this.state, modalIsOpen: false });
this.setState(Object.assign({}, this.state, { modalIsOpen: false }));
},

openSecondModal: function(event) {
event.preventDefault();
this.setState({ ...this.state, modal2:true });
this.setState(Object.assign ({}, this.state, { modal2: true }));
},

closeSecondModal: function() {
this.setState({ ...this.state, modal2:false });
this.setState(Object.assign ({}, this.state, { modal2: false }));
},

handleModalCloseRequest: function() {
// opportunity to validate something and keep the modal open even if it
// requested to be closed
this.setState({ ...this.state, modalIsOpen: false });
this.setState(Object.assign ({}, this.state, { modalIsOpen: false }));
},

handleInputChange: function() {
Expand Down

0 comments on commit 99c7e32

Please sign in to comment.