diff --git a/client/src/components/game.construct.jsx b/client/src/components/game.construct.jsx index 79f2a8bc..75a1677d 100644 --- a/client/src/components/game.construct.jsx +++ b/client/src/components/game.construct.jsx @@ -85,21 +85,36 @@ class GameConstruct extends Component { this.resolvedLength = 0; } + shouldComponentUpdate(newProps) { + if (newProps.activeSkill !== this.props.activeSkill) return true; + if (newProps.animFocus !== this.props.animFocus) return true; + if (newProps.animText !== this.props.animText) return true; + if (newProps.animating !== this.props.animating) return true; + if (newProps.construct !== this.props.construct) return true; + if (newProps.player !== this.props.player) return true; + if (newProps.tutorialGame !== this.props.tutorialGame) return true; + if (newProps.gameSkillInfo !== this.props.gameSkillInfo) return true; + return false; + } + render() { const { - i, + // Changing state variables + activeSkill, + animFocus, + animText, animating, construct, player, - activeSkill, - selectSkillTarget, - animFocus, - animText, tutorialGame, + gameSkillInfo, + // Constants + i, + itemInfo, + // Functions + selectSkillTarget, setTutorialGameClear, setGameEffectInfo, - gameSkillInfo, - itemInfo, } = this.props; const ko = construct.green_life.value === 0 ? 'ko' : ''; @@ -145,7 +160,7 @@ class GameConstruct extends Component { > {c.effect} - {c.duration}T) : null; return (