Suggest JSX fragment syntax in adjacent tag error (#7152)

This commit is contained in:
Sophie Alpert 2018-01-03 22:21:39 -10:00 committed by Nicolò Ribaudo
parent 82c6ca2f96
commit 8250ff963e
2 changed files with 3 additions and 2 deletions

View File

@ -471,7 +471,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
if (this.match(tt.relational) && this.state.value === "<") { if (this.match(tt.relational) && this.state.value === "<") {
this.raise( this.raise(
this.state.start, this.state.start,
"Adjacent JSX elements must be wrapped in an enclosing tag", "Adjacent JSX elements must be wrapped in an enclosing tag. " +
"Did you want a JSX fragment <>...</>?",
); );
} }

View File

@ -1,3 +1,3 @@
{ {
"throws": "Adjacent JSX elements must be wrapped in an enclosing tag (1:22)" "throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (1:22)"
} }