getSnapshotBeforeUpdate(prevProps) { return { notifyRequired: prevProps.text !== this.props.text }; } code example
Example: component did update arguments
componentDidUpdate(prevProps, prevState) {
// only update chart if the data has changed
if (prevProps.data !== this.props.data) {
this.chart = c3.load({
data: this.props.data
});
}
}