graphene/docs/playground/wrapper.js

23 lines
521 B
JavaScript
Raw Normal View History

2015-11-27 10:50:37 +03:00
// require.ensure([], function(require) {
// require.include('../playground/page');
// });
var React = require('react');
class App extends React.Component {
constructor() {
super();
this.state = { currentComponent: null };
}
componentDidMount() {
require(["playground-page"], (Playground) =>{
this.setState({
currentComponent: Playground
});
});
}
render() {
var Current = this.state.currentComponent;
return Current?<Current />:null;
}
}
module.exports = App;