mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-30 05:23:57 +03:00
22 lines
453 B
JavaScript
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;
|