import React, { Component } from 'react'; import { hot } from 'react-hot-loader'; import { connect } from 'react-redux'; import { StoreState } from 'app/types'; import { ExploreId } from 'app/types/explore'; import Explore from './Explore'; import { CustomScrollbar, ErrorBoundaryAlert } from '@grafana/ui'; import { resetExploreAction } from './state/actionTypes'; interface WrapperProps { split: boolean; resetExploreAction: typeof resetExploreAction; } export class Wrapper extends Component { componentWillUnmount() { this.props.resetExploreAction(); } render() { const { split } = this.props; return (
{split && ( )}
); } } const mapStateToProps = (state: StoreState) => { const { split } = state.explore; return { split }; }; const mapDispatchToProps = { resetExploreAction, }; export default hot(module)( connect( mapStateToProps, mapDispatchToProps )(Wrapper) );