p5.js-web-editor/client/modules/App/App.js
2016-06-23 18:29:55 -04:00

25 lines
581 B
JavaScript

import React from 'react';
import { connect } from 'react-redux';
import DevTools from './components/DevTools';
class App extends React.Component {
constructor(props, context) {
super(props, context);
this.state = { isMounted: false };
}
componentDidMount() {
this.setState({ isMounted: true });
}
render() {
return (
<div className="app">
{this.state.isMounted && !window.devToolsExtension && process.env.NODE_ENV === 'development' && <DevTools />}
{this.props.children}
</div>
);
}
}
export default connect()(App);