2 ms·
It's worth noting that both the React and Redux teams generally discourage the use of decorators. Quoting the Create-React-App README: > Create React App does
by acemarke 9y ago
It's worth noting that both the React and Redux teams generally discourage the use of decorators. Quoting the Create-React-App README:
> Create React App doesn’t support decorator syntax at the moment because:
> - It is an experimental proposal and is subject to change.
> - The current specification version is not officially supported by Babel.
> - If the specification changes, we won’t be able to write a codemod because we don’t use them internally at Facebook.
> Create React App will add decorator support when the specification advances to a stable stage.
In addition, use of the React-Redux `connect` method as a decorator can lead to unexpected behavior, such as `defaultProps` applying to the generated wrapper component instead of the underlying "plain" component. I'm not sure how the `kea` decorator handles that sort of thing.