Skip to content

Commit

Permalink
[fixed] rewrite removePortal as es5 function
Browse files Browse the repository at this point in the history
Uglifyjs doesn't know anything about es6, so 1.7.0 breaks my build script with error
```
ERROR in index_586f597d6f9d7177eb8b.js from UglifyJs
SyntaxError: Unexpected token punc «(», expected punc «:» [./~/react-modal/lib/components/Modal.js:103,0]
```

fix es6 -> es5
  • Loading branch information
Vitaly Kravtsov authored and claydiffrient committed Mar 2, 2017
1 parent 975e9ab commit a1d29c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var Modal = React.createClass({
}
},

removePortal () {
removePortal: function() {
ReactDOM.unmountComponentAtNode(this.node);
var parent = getParentElement(this.props.parentSelector);
parent.removeChild(this.node);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var ModalPortal = module.exports = React.createClass({
focusManager.teardownScopedFocus();
},

open () {
open: function () {
if (this.state.afterOpen && this.state.beforeClose) {
clearTimeout(this.closeTimer);
this.setState({ beforeClose: false });
Expand Down

0 comments on commit a1d29c6

Please sign in to comment.