5 ms·
A blend of both? Drop in a React component where needed on a given page! People forget (me included) that even React can be mounted into a single DOM element.
by fullstackchris 2y ago
A blend of both? Drop in a React component where needed on a given page! People forget (me included) that even React can be mounted into a single DOM element.
With all this framework nonsense its hard to forget at the end of the days its all just javascript.
- deleted 2y ago[deleted]
- mst 2y agoIf you're doing something something reasonably small, using preact rather than react and then wrapping it into a web component so you can just ... put it in there ... is a really nice option to have. (it may not be the right option in any given case, but it's worth knowing it's there even so)
- throwitaway1123 2y agoPreact is definitely a good choice if you're looking for something lightweight. React-dom was already relatively hefty, and seems to have gotten even larger in version 19. Upgrading the React TypeScript Vite starter template from 18 to 19 increases the bundle size from 144kB to 186kB on my machine [1][2]. They've also packaged it in a way that's hard to analyze with sites like bundlephobia.com and pkg-size.dev. [1] https://github.com/facebook/react/issues/27824 https://github.com/facebook/react/issues/27824 [2] https://github.com/facebook/react/issues/29913 https://github.com/facebook/react/issues/29913