DEV Community

loading...

Discussion on: The perfect React's component doesn't exist. 🤯

Collapse
jsco profile image
Jesco Wuester • Edited

I feel like this article is falling into a common performance trap. React is really fast by default and these deep equality checks and so on are usually slower than just rerendering the component. For performance, measure first and if your component is slow (which very very rarely happens) you can think about how to improve it. Check out this post for more details on performance cdb.reacttraining.com/react-inline.... So the perfect component does exist, and it's already the default component :D

Appreciate all your content just a bit worried that this post may mislead some newer folks :)

Collapse
bassemmohamed profile image
Bassem Ibrahim👨‍💻🇪🇬 Author

Thanks for your comment. 🙏

If you aren’t measuring, you can’t even know if your optimizations are better, and you certainly won’t know if they make things worse!

This totally makes sense! We use PureComponent everywhere where I am working ( It is like a rule ). You got me excited to measure the difference though. I will definitely try to do that in the near future. 😊