diff --git a/src/Node/index.tsx b/src/Node/index.tsx index 6f5acae1..1cb16397 100644 --- a/src/Node/index.tsx +++ b/src/Node/index.tsx @@ -66,15 +66,16 @@ export default class Node extends React.Component { this.commitTransform(); } - shouldComponentUpdate(nextProps: NodeProps) { - return this.shouldNodeTransform(this.props, nextProps); + shouldComponentUpdate(nextProps: NodeProps, nextState: NodeState) { + return this.shouldNodeTransform(this.props, nextProps, this.state, nextState); } - shouldNodeTransform = (ownProps: NodeProps, nextProps: NodeProps) => + shouldNodeTransform = (ownProps: NodeProps, nextProps: NodeProps, ownState: NodeState, nextState: NodeState) => nextProps.subscriptions !== ownProps.subscriptions || nextProps.position.x !== ownProps.position.x || nextProps.position.y !== ownProps.position.y || - nextProps.orientation !== ownProps.orientation; + nextProps.orientation !== ownProps.orientation || + nextState.wasClicked !== ownState.wasClicked; setTransform( position: NodeProps['position'],