0

In my React Native component, I added an empty shouldComponentUpdate

shouldComponentUpdate(nextProps, nextState) {
        
}

I know from this answer that having an empty shouldComponentUpdate results in eliminating all unnecessary re-renders. If I return true in the body of shouldComponentUpdate though, will that be identical to removing shouldComponentUpdate?

isherwood
  • 58,414
  • 16
  • 114
  • 157
gkeenley
  • 6,088
  • 8
  • 54
  • 129

1 Answers1

0

The default implementation of the method returns true which means in your case removing the shouldComponentUpdate will result in the same behavior.

https://reactjs.org/docs/optimizing-performance.html#shouldcomponentupdate-in-action

enter image description here

Numan Ijaz
  • 878
  • 1
  • 8
  • 18