Skip to content

Commit 5dd1a47

Browse files
Error when using fragment with jsxFactory
1 parent 961495b commit 5dd1a47

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14076,6 +14076,11 @@ namespace ts {
1407614076

1407714077
function checkJsxFragment(node: JsxFragment): Type {
1407814078
checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment);
14079+
14080+
if (compilerOptions.jsx === JsxEmit.React && compilerOptions.jsxFactory) {
14081+
error(node, Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory);
14082+
}
14083+
1407914084
return getJsxGlobalElementType() || anyType;
1408014085
}
1408114086

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,6 +3615,10 @@
36153615
"category": "Error",
36163616
"code": 17015
36173617
},
3618+
"JSX fragment is not supported when using --jsxFactory": {
3619+
"category": "Error",
3620+
"code":17016
3621+
},
36183622

36193623
"Circularity detected while resolving configuration: {0}": {
36203624
"category": "Error",

0 commit comments

Comments
 (0)