Answers for "is it good to yse before component did mount"

2

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
    });
  }
}
Posted by: Guest on October-05-2020
0

shouldcomponentupdate default return

By default, shouldComponentUpdate returns true, but you can override it to return false for cases that you do not want a re-render.
Posted by: Guest on December-03-2020

Code answers related to "is it good to yse before component did mount"

Browse Popular Code Answers by Language