fix: correct module instead of react

This commit is contained in:
Hongarc 2019-04-25 10:02:00 +07:00
parent 64eb8ab773
commit 208a6c843a
5 changed files with 17 additions and 18 deletions

View file

@ -1,8 +1,9 @@
var React = require('react');
var ReactDOM = require('react-dom');
var PropTypes = require('prop-types');
var reactUtil = require('../util/reactUtil');
var keyMirror = require('react/lib/keyMirror');
var keyMirror = require('fbjs/lib/keyMirror');
var STATUSES = keyMirror({
inqueue: null,
@ -24,16 +25,7 @@ class CommandView extends React.Component{
}
onModelDestroy() {
if (!this.isMounted()) {
return;
}
if (!this.getDOMNode) {
// WTF -- only happens in casperjs tests weirdly
console.error('this.getDOMNode not a function?');
return;
}
React.unmountComponentAtNode(this.getDOMNode().parentNode);
ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(this).parentNode);
}
updateStateFromModel() {