React-common optimization techniques

First, use shouldComponentUpdate

If false is returned, the page will not be rendered. If true, the page will be rendered

Second, the class component uses PureComponent (note that PureComponent is a shallow comparison)

Third, the function component uses memo (note that memo is also shallow comparison)

Published 35 original articles · won praise 1 · views 6718

Guess you like

Origin blog.csdn.net/qq_36162529/article/details/102683184