top | item 44716932

(no title)

SSchick | 7 months ago

I still don't 100% understand why `React.memo` is not applied by default, wrapping every single component in a `memo` is crazy overhead and non-trivial to enforce codebase-wide.

Sure performance is a concern but is recursive re-rendering really cheaper than memoing all props?

discuss

order

mmis1000|7 months ago

Someone used to argument with me that "it will make render pass that use external value works if it always renders".

But I wonder should it even work at first place? It feels like you are covering the problem instead of actually fix it. Make broken things broken is a lot healthier for the code base in my opinion.

Immediately find out things to be broken is 100x better than find out it suddenly not works and can't even figure out why is it broken months later in my opinion.

Use external value in Vue is very noticeable in contrary to React. Because it will definitely not work even once. The in component computed or component itself both enforce memorize . Render will be skipped completely it you used external values there so the framework did not notice anything is changed.

johnny22|7 months ago

that's the the react compiler is supposed to be able do, memoize when necessary