3 ms·
After having worked on React for a while, I can tell you that the problem remains between monitor and chair. React can have all the niceties and optimization i
by bapak 1y ago
After having worked on React for a while, I can tell you that the problem remains between monitor and chair.
React can have all the niceties and optimization in the world, but that fails when its users insist on using it incorrectly, building huge tangled messy components and then wondering why a click takes 1.3 seconds to deliver feedback.
- culi 1y agoAs someone who's worked with React professionally for years, it's honestly shocking how few React developers really understand memoization and when it needs to be used IMO it's the MAIN thing to understand about React—how it renders. Regardless, now I'm the one with egg on my face since the new compiler promises to eventually remove the need for manual memoization almost entirely. The "almost" still fills me with fear
- adithyassekhar 1y agoIs there a good article or something you could point us younglings to? I get that in react almost everything is reactive by default unlike other frameworks. I tend to add useCallback and memo to everything nowadays.
- moi2388 1y agoThat only works if the inputs don’t change often. If they do, it’s actually a performance hit.
- culi 1y agoThis was one of the best guides out there when it came out. It's from 2021 but I think it still holds up https://alexsidorenko.com/blog/react-render-always-rerenders https://alexsidorenko.com/blog/react-render-always-rerenders It's a set of 6 short and sweet posts that breaks down rendering behavior, memoization, and relevant hooks
- mvdtnz 1y agoThe problem that is that react doesn't have a pit of success. Because it's poorly conceived, poorly designed and poorly written software made by people more interested in getting the word "homomorphism" onto their CV than solving real problems. You knew when they started using terms like "monad" and "functor" in order to attach a click handler to a button that something had gone badly wrong. In this very thread there's some asshole using the word "memoization" when "caching" would have been fine.