5 ms·
After minification and compression, React is about 100kb and can be cached for a long time. With all the images, videos on social media etc. it seems rather sm
by quonn 6y ago
After minification and compression, React is about 100kb and can be cached for a long time.
With all the images, videos on social media etc. it seems rather small in terms of bandwidth.
- okareaman 6y agoI'm not counting images and videos because all sites have that problem, but things like clicking on the notifications icon and then waiting for it too load and it never does so I have to give up and go back to my phone.
- Trasmatta 6y agoI thought it was actually around 30kb, after being minified and gzipped?
- okareaman 6y agoIt's not the size of the React library that is the problem, it's the nesting of components with components within components that is the problem. If you've ever shown source and seen divs 20 to 30 deep, you're most likely looking at html that React produces.
- tpict 6y agoA React component has no obligation to add a div or any other element to the DOM tree.
- okareaman 6y agoDan Ambramov has stated the reason hooks was created was to avoid nesting hell that was used to manage state. I may be misunderstanding him. I am not s React expert.
- tpict 6y agoI believe "nesting hell" was in reference to obtuse state management architecture rather than DOM structure. It seems like a common misconception based off other comments on this post. Angular inserts a new custom element for every component so it's definitely a problem elsewhere, if not with React.
- pshc 6y agoReact needs to borrow the idea of 'zero-cost abstractions' from Rust. Too often I've seen five divs used to add five layers of behavior where one (or zero) divs could have had the same effect.
- quonn 6y agoWith react dom and everything?