You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to address some adjustment improvement to remove the need for use UNSAFE_componentWillReceiveProps as it throws an error with react 17 and use shouldComponentUpdate method instance
and here my suggestion, it ok?
shouldComponentUpdate(nextProps,nextState){if(this.state.connected){// Subscribe to new topicsdifference(nextProps.topics,this.props.topics).forEach((newTopic)=>{this._log('Subscribing to topic: '+newTopic)this._subscribe(newTopic)})// Unsubscribe from old topicsdifference(this.props.topics,nextProps.topics).forEach((oldTopic)=>{this._log('Unsubscribing from topic: '+oldTopic)this._unsubscribe(oldTopic)})}returnfalse}
The text was updated successfully, but these errors were encountered:
I want to address some adjustment improvement to remove the need for use
UNSAFE_componentWillReceiveProps
as it throws an error with react 17 and useshouldComponentUpdate
method instanceand here my suggestion, it ok?
The text was updated successfully, but these errors were encountered: