dillon1000/react

Commit

Modify Babel React JSX Duplicate Children Fix (#17101)

If a JSX element has both a children prop and children (ie. <div children={childOne}>{childTwo}</div>), IE throws an Multiple definitions of a property not allowed in strict mode. This modifies the previous fix (which used an Object.assign) by making the duplicate children a sequence expression on the next prop/child instead so that ordering is preserved. For example:

```
<Component children={useA()} foo={useB()} children={useC()}>{useD()}</Component>
```
should compile to
```
React.jsx(Component, {foo: (useA(), useB()), children: (useC(), useD)})
```
Browse files
Changed paths3 files
First-parent comparison
M packages/babel-plugin-react-jsx/__tests__/TransformJSXToReactJSX-test.js ModifiedM packages/babel-plugin-react-jsx/__tests__/__snapshots__/TransformJSXToReactJSX-test.js.snap ModifiedM packages/babel-plugin-react-jsx/src/TransformJSXToReactBabelPlugin.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…