Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parameters or JSX dev runtime (#3880)
* There was a parameter missing (`isStaticChildren: boolean`), which is not useful\*, but is still being passed * Fix order of `source` and `self` again (incorrectly introduced in GH-3459) * Fix some (internal JSDoc) types for these parameters My guess is that the previous PR “fixed” the earlier problem because `self` isn’t used, so by calling `isStaticChildren` “`self`”, a bug went away. The source for where this `jsxDEV` call is generated in Babel is here: <https://github.com/babel/babel/blob/3952486/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts#L506-L508>. The React RFC for the transform that mentions the dev runtime is here: <https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md#dev-only-transforms> \* `isStaticChildren` is the same as whether `jsxs` would be used, instead of `jsx`. Which is also whether there are 2 or more children passed: * `<a />` -> `jsx('a', {})` * `<a>b</a>` -> `jsx('a', {children: 'b'})` * `<a>{1}{2}</a>` -> `jsxs('a', {children: [1, 2]})` Related-to: GH-3459.
- Loading branch information