Tips and Tricks

suggest change

When two nodes are not of the same type, React doesn’t try to match them. It removes the first node from the DOM and inserts the second one. That is why the first tip says:

  1. If you see yourself alternating between two component classes with very similar output, you may want to make them the same class.

  1. Use shouldComponentUpdate to skip a render when you know the output will not change, for example:
shouldComponentUpdate: function(nextProps, nextState) {
  return nextProps.id !== this.props.id; 
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents