Есть компонент ContentMap. У него VotingInfoBlock и GoogleLegend. При клике срабатывает событие onClickDistrict. И нужно обновить компонент VotingInfoBlock не трогая GoogleLegend. Как это правильно сделать?
class ContentMap extends Component {
// ! вот тут я кликнул на районе Москвы и мне надо обновить тексты в блоке
onClickDistrict(name) {
this.VotingInfoBlockEl.props.headerTitle= 'Киевский район';
this.VotingInfoBlockEl.props.headerText= 'Кандидат победивший на выборах это: Бобров 77%';
}
render() {
return (
<div className="mayor2018__map">
<VotingInfoBlock
ref={el => {
this.VotingInfoBlockEl = el;
}}
headerTitle="Кунцево"
headerText="Кандидат победивший на выборах это: "
/>
<GoogleLegend onClickDistrict={this.onClickDistrict.bind(this)} />
</div>
);
}
}