Converting shouldcomponentupdate to memo in React

  javascript, react-usememo, reactjs

What will be the equivalent code using React memo?

 shouldComponentUpdate(nextProps) {

    if (this.props.addCourse !== nextProps.addCourse || this.props.level !== nextProps.level ) {
      return true;
    } else {
      return false;
    }
  }

Source: Ask Javascript Questions

LEAVE A COMMENT