Revert "Revert babel-helper-builder-react-jsx change from #4988" (#9119)

This reverts commit dbc07220ae9188a3fb2bdea3d826ff7f48532a2e.

# Conflicts:
#	packages/babel-helper-builder-react-jsx/src/index.js
This commit is contained in:
Daniel Tschinder 2019-01-05 22:22:49 -08:00 committed by GitHub
parent a58893d1e3
commit 54f072991d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -19,6 +19,13 @@ You can turn on the 'throwIfNamespace' flag to bypass this warning.`,
); );
} }
}; };
visitor.JSXSpreadChild = function(path) {
throw path.buildCodeFrameError(
"Spread children are not supported in React.",
);
};
visitor.JSXElement = { visitor.JSXElement = {
exit(path, file) { exit(path, file) {
const callExpr = buildElementCall(path, file); const callExpr = buildElementCall(path, file);

View File

@ -0,0 +1 @@
<div>{...children}</div>;

View File

@ -0,0 +1,3 @@
{
"throws": "Spread children are not supported in React."
}