Skip to content

Commit

Permalink
Merge pull request #36 from chentsulin/patch-3
Browse files Browse the repository at this point in the history
fix #35, release ref when will unmount
  • Loading branch information
securingsincity committed Aug 22, 2015
2 parents 1975760 + fd2ced7 commit 3dcba6b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ module.exports = React.createClass({
this.props.onLoad(this.editor);
}
},


componentWillUnmount: function() {
this.editor = null;
},

componentWillReceiveProps: function(nextProps) {
this.editor = ace.edit(nextProps.name);
this.editor.getSession().setMode('ace/mode/'+nextProps.mode);
Expand Down

0 comments on commit 3dcba6b

Please sign in to comment.