Remove unnecessary renders in map / timeline and style narrative mode

This commit is contained in:
Franc Camps-Febrer
2018-12-14 09:44:38 +01:00
committed by Lachlan Kermode
parent 3e9b621655
commit 0bc4ddc54e
8 changed files with 52 additions and 27 deletions

View File

@@ -26,6 +26,7 @@ class NarrativeCard extends React.Component {
componentDidUpdate() {
if (this.props.narrative !== null) {
const step = this.props.narrative.steps[this.state.step];
console.log(step)
this.props.onSelect([step]);
}
}
@@ -34,7 +35,7 @@ class NarrativeCard extends React.Component {
return (
<button
className="side-menu-burg is-active"
onClick={() => { this.props.actions.updateNarrative(null); }}
onClick={() => { this.props.onSelectNarrative(null); }}
>
<span></span>
</button>