3 ms·
> Hooks allow you to reuse stateful logic without changing your component hierarchy. Why haven't ES7 decorators been more widely adopted for this? We've been u
by iEchoic 8y ago
> Hooks allow you to reuse stateful logic without changing your component hierarchy.
Why haven't ES7 decorators been more widely adopted for this? We've been using them for over a year for this purpose now and they've ended up being far cleaner, more powerful, and more composable than the proposed interface.
- styfle 8y agoDecorators haven't been adopted because they are not specced or shipped. There is no decorator feature in the ES7 (ES2016) spec. However, there is a proposal for decorators that it is not finalized yet. https://github.com/tc39/proposal-decorators https://github.com/tc39/proposal-decorators