From 99c7e329761749d5e2521e441fd6c453c47480fd Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Tue, 6 Jun 2017 21:32:21 -0300 Subject: [PATCH] [fixed] use Object.assign for now. While the don't move to v2, we can use Object.assign and later use the spread operator. --- examples/basic/app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/basic/app.js b/examples/basic/app.js index 7e01f5b2..83ff3a1b 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -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() {