[transform-react-jsx] Add useSpread option to transform JSX (#10572)
* [transform-react-jsx] Add useSpread option to transform JSX * Add validation for default option * Add error when using useSpread and useBuiltIns at the same time * Move useSpread to convertAttribute helper function * Add useSpread option to presect-react * Remove casting useSpread to boolean in preset-react option. Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
committed by
Nicolò Ribaudo
parent
8ffca0475a
commit
3d2f365074
@@ -13,6 +13,7 @@ export default declare((api, opts) => {
|
||||
opts.throwIfNamespace === undefined ? true : !!opts.throwIfNamespace;
|
||||
const development = !!opts.development;
|
||||
const useBuiltIns = !!opts.useBuiltIns;
|
||||
const { useSpread } = opts;
|
||||
|
||||
if (typeof development !== "boolean") {
|
||||
throw new Error(
|
||||
@@ -24,7 +25,7 @@ export default declare((api, opts) => {
|
||||
plugins: [
|
||||
[
|
||||
transformReactJSX,
|
||||
{ pragma, pragmaFrag, throwIfNamespace, useBuiltIns },
|
||||
{ pragma, pragmaFrag, throwIfNamespace, useBuiltIns, useSpread },
|
||||
],
|
||||
transformReactDisplayName,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user