Skip to content

Commit 99c7e32

Browse files
committed
[fixed] use Object.assign for now.
While the don't move to v2, we can use Object.assign and later use the spread operator.
1 parent 39cec6f commit 99c7e32

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/basic/app.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ var App = React.createClass({
1313
},
1414

1515
openModal: function() {
16-
this.setState({ ...this.state, modalIsOpen: true });
16+
this.setState(Object.assign({}, this.state, { modalIsOpen: true }));
1717
},
1818

1919
closeModal: function() {
20-
this.setState({ ...this.state, modalIsOpen: false });
20+
this.setState(Object.assign({}, this.state, { modalIsOpen: false }));
2121
},
2222

2323
openSecondModal: function(event) {
2424
event.preventDefault();
25-
this.setState({ ...this.state, modal2:true });
25+
this.setState(Object.assign ({}, this.state, { modal2: true }));
2626
},
2727

2828
closeSecondModal: function() {
29-
this.setState({ ...this.state, modal2:false });
29+
this.setState(Object.assign ({}, this.state, { modal2: false }));
3030
},
3131

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

3838
handleInputChange: function() {

0 commit comments

Comments
 (0)