const preact = require('preact'); const { connect } = require('preact-redux'); const shapes = require('./shapes'); const addState = connect(({ animText }) => ({ animText })); class GameConstructLife extends preact.Component { shouldComponentUpdate(newProps) { if (newProps.animText !== this.props.animText) { if (newProps.animText && newProps.animText.target === this.props.construct.id) { const [type] = newProps.animText.variant; if (type === 'Damage' || type === 'Healing' || type === 'Recharge') return true; } } if (newProps.construct !== this.props.construct) return true; return false; } render() { const { construct, animText } = this.props; const lifeBars = (redLife, greenLife, blueLife) => { return (