Есть такой компонент
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import * as actions from '../../store/actions/index';
import Filter from 'components/Filter';
import TopTenSlider from 'components/TopTenSlider';
import MobileAppSection from 'components/MobileAppSection';
import RecommendedClubs from 'components/RecommendedClubs/';
import './styles.scss';
class Landing extends Component {
static displayName = 'Landing';
state = {
topTenClubs: []
};
componentDidMount() {
this.props.onFetchTopTenClubs();
}
render() {
const {
topTenClubs,
clubClasses,
recommendedClubs,
trainingTypes,
subwayStations
} = this.props.landingState;
console.log(this.props.landingState);
let landing;
return (
<Fragment>
{Object.keys(this.props.landingState) > 0 && (
<Fragment>
<Filter />
{topTenClubs && <TopTenSlider clubs={topTenClubs} />}
<RecommendedClubs />
<MobileAppSection />
</Fragment>
)}
</Fragment>
);
}
}
const mapStateToProps = state => {
return {
landingState: state.landing
};
};
const mapDispatchToProps = dispatch => {
return {
onFetchTopTenClubs: () => dispatch(actions.initLandingState())
};
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(Landing);
почему он может не перерисовывается когда данные поступают?