graphene/docs/playground/wrapper.js
2015-11-28 03:34:49 -08:00

22 lines
453 B
JavaScript

import React from 'react';
class PlaygroundWrapper 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 = PlaygroundWrapper;