import Spinner from './../components/Spinner';
export default class App extends React.Component {
+ state = { componentSet: false };
+
componentDidMount () {
this.props.setComponent(this.props.component);
this.props.fetchMetrics();
+ this.setState({ componentSet: true });
}
render () {
- const { metrics } = this.props;
-
- if (metrics == null) {
+ if (this.props.metrics == null || !this.state.componentSet) {
return <Spinner/>;
}
dispatch(startFetching());
const state = getState();
+ /* eslint-disable no-console */
+ console.log(state);
const component = getMeasuresAppComponent(state);
const metrics = getMeasuresAppAllMetrics(state);