graphene/docs/playground/wrapper.js

22 lines
453 B
JavaScript
Raw Normal View History

import React from 'react';
class PlaygroundWrapper extends React.Component {
2015-11-27 10:50:37 +03:00
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 = PlaygroundWrapper;