Hi,
As you mentioned already on docs, at the moment we can not rewrite our exiting components to support hooks (Hooks could reduce your bundle size), so what if we want to update react to latest version (for bug fixes, ...), but don't want to add that 1.5KB to our bundle size?
Thanks
If 1.5KB (~4%) is a bottleneck for you, perhaps React isn’t the right choice for your application. The size of React always fluctuates somewhat between releases. You can hold off updating until we manage to reduce it but generally reductions come from major releases (because they enable us to delete legacy code). Deleting legacy code is not possible without adding alternatives during the previous major so we don’t really have options there.
For some perspective, your avatar on this page weighs more than the Hooks implementation.
Even if you can't use Hooks in your app directly, some third party libraries will be able to do so — so you might in the end get some bundle size improvements.
Of course I don't switch to another framework for 1.5KB, I love React.
I just saying as you mentioned Hooks is new feature and maybe change in future, so I think you will add more codes (I'm not sure btw), so maybe you should think about it, I think at the beginning React DOM wasn't separate package.
Btw Github should use better code for generating avatars.
In the long term it's more likely we'll move classes to a separate package. Their implementation creates more internal complexity for React than Hooks.
I know this issue is closed and won't be opened again, but I think I didn't answer following part and I'm going to do that
For some perspective, your avatar on this page weighs more than the Hooks implementation.
Let's say React is used by 124,000 sites and each of them have 100 users in average, so 12,400,000 requests will be sent and let's say Hooks adds 1KB to the library, that means 12.4GB more data has to be transferred because of Hook. so my Avatar isn't the problem here and I think it's not even right example, 2 completely different situations.
@gaearon I used hooks in my recent project and I should say it's really great and fun to work with. I just want to share my opinion about hooks with you.
Most helpful comment
In the long term it's more likely we'll move classes to a separate package. Their implementation creates more internal complexity for React than Hooks.