Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17630 from code-dot-org/react-no-createclass-netsim
React: Remove uses of React.createClass in netsim
- Loading branch information
Showing
4 changed files
with
52 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
|
||
import React, {PropTypes} from 'react'; | ||
var ProtectedStatefulDiv = require('../templates/ProtectedStatefulDiv'); | ||
var StudioAppWrapper = require('../templates/StudioAppWrapper'); | ||
import ProtectedStatefulDiv from '../templates/ProtectedStatefulDiv'; | ||
import StudioAppWrapper from '../templates/StudioAppWrapper'; | ||
|
||
/** | ||
* Top-level React wrapper for our NetSim app. | ||
*/ | ||
var NetSimView = React.createClass({ | ||
propTypes: { | ||
export default class NetSimView extends React.Component { | ||
static propTypes = { | ||
generateCodeAppHtml: PropTypes.func.isRequired, | ||
onMount: PropTypes.func.isRequired | ||
}, | ||
}; | ||
|
||
componentDidMount: function () { | ||
componentDidMount() { | ||
this.props.onMount(); | ||
}, | ||
} | ||
|
||
render: function () { | ||
render() { | ||
return ( | ||
<StudioAppWrapper> | ||
<ProtectedStatefulDiv contentFunction={this.props.generateCodeAppHtml} /> | ||
</StudioAppWrapper> | ||
); | ||
} | ||
}); | ||
module.exports = NetSimView; | ||
} |