Feature Request
Is your feature request related to a problem? Please describe.
Currently, transform-react-jsx either outputs uses of the extend helper or calls to Object.assign for handling spread props (any attribute with {...Expression}).
Describe the solution you'd like
An option to instead convert such instances to an inline object with spread elements.
This would still allow @babel/preset-env to further transform the inline object if the allowed targets don't support object spread.
Teachability, Documentation, Adoption, Migration Strategy
If it wasn't a semver-major change I'd be as bold as to say that it's safe to make it enabled by default -- I suspect almost no project runs @babel/preset-react without also using @babel/preset-env, and native object rest spread has been supported by it even without requiring the shippedProposals option. It has also been shipping on browsers and node (LTS, even) for over a year.
Feature Request
Is your feature request related to a problem? Please describe.
Currently, transform-react-jsx either outputs uses of the
extendhelper or calls toObject.assignfor handling spread props (any attribute with{...Expression}).Describe the solution you'd like
An option to instead convert such instances to an inline object with spread elements.
This would still allow
@babel/preset-envto further transform the inline object if the allowed targets don't support object spread.Teachability, Documentation, Adoption, Migration Strategy
If it wasn't a semver-major change I'd be as bold as to say that it's safe to make it enabled by default -- I suspect almost no project runs
@babel/preset-reactwithout also using@babel/preset-env, and native object rest spread has been supported by it even without requiring theshippedProposalsoption. It has also been shipping on browsers and node (LTS, even) for over a year.