logoalt Hacker News

wg0yesterday at 8:14 PM3 repliesview on HN

You can now use React Compiler and there would be no virtual DOM.

Already being used in production at large code bases.


Replies

puskurukyesterday at 8:25 PM

React Compiler(originally react-forget) is a build-time tool that automatically optimizes your React app by automatically memoizing your code. It only replaces the manual ceremony of useMemo, useCallback, and React.memo with automatic caching at compile time. So, it's fixing the problem they introduced by React itself or you we can call it a "trade-off" in a sense

bogdanyesterday at 10:04 PM

You can and you can't. There's still plenty of very popular libraries that don't behave correctly with it. That's more on the libraries than on the compiler but that's the current state of things.

dasherswyesterday at 8:57 PM

Yeah afaik React Compiler doesn't really replace virtual DOM.