Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 410ee43

Browse files
committed
fix support for recursive components in JSX4
1 parent 913aa08 commit 410ee43

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cli/reactjs_jsx_v4.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,12 @@ let transformStructureItem ~config mapper item =
10431043
in
10441044
let innerExpression =
10451045
Exp.apply
1046-
(Exp.ident (Location.mknoloc @@ Lident fnName))
1046+
(Exp.ident
1047+
(Location.mknoloc
1048+
@@ Lident
1049+
(match recFlag with
1050+
| Recursive -> internalFnName
1051+
| Nonrecursive -> fnName)))
10471052
([(Nolabel, Exp.ident (Location.mknoloc @@ Lident "props"))]
10481053
@
10491054
match hasForwardRef with

tests/ppx/react/expected/v4.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module Rec = {
2626
make(({}: props))
2727
}
2828
and make = {
29-
let \"V4$Rec" = props => make(props)
29+
let \"V4$Rec" = props => \"make$Internal"(props)
3030

3131
\"V4$Rec"
3232
}

0 commit comments

Comments
 (0)