gothinkster / react-mobx-realworld-example-app

Exemplary real world application built with React + MobX
https://react-mobx.realworld.io/
MIT License
1.25k stars 266 forks source link

Use pure components there possible #38

Open anjmao opened 5 years ago

anjmao commented 5 years ago

Hi, there are quite few places there PureComponent or React.memo could be used to reduce rerender.

For example https://github.com/gothinkster/react-mobx-realworld-example-app/blob/master/src/components/ListPagination.js#L3 . ListPagination is rendered 3 times on each page change, if I wrap it in React.memo it is rendered only one time as it should be.

Other components which cause unneeded rerender EditProfileSettings, FollowUserButton, Banner, YourFeedTab, GlobalFeedTab, TagFilterTab.