Skip to content

Commit 2271d99

Browse files
cristianoccknitt
authored andcommitted
gentype: support Jsx.element in addition to React.element
The type Jsx.element can show user-side in ppx V4 (at least), and affects gentype too. It special-cases `React.element`, and needs to then special-case `Jsx.element` too. Fixes #6807 # Conflicts: # CHANGELOG.md
1 parent 8da810b commit 2271d99

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Fix location of let bindings with attributes. https://github.com/rescript-lang/rescript-compiler/pull/6791
1818
- PPX v4: mark props type in externals as `@live` to avoid dead code warnings for prop fields in the editor tooling. https://github.com/rescript-lang/rescript-compiler/pull/6796
1919
- Fix issue where optional labels were not taken into account when disambiguating record value construction. https://github.com/rescript-lang/rescript-compiler/pull/6798
20+
- Fix issue in gentype when type `Jsx.element` surfaces to the user. https://github.com/rescript-lang/rescript-compiler/pull/6808
2021

2122
# 11.1.1
2223

jscomp/gentype/TranslateTypeExprFromTypes.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ let translateConstr ~config ~paramsTranslation ~(path : Path.t) ~typeEnv =
215215
{dependencies = []; type_ = EmitType.typeReactEventMouseT}
216216
| ( ( ["React"; "element"]
217217
| ["ReactV3"; "React"; "element"]
218-
| ["ReasonReact"; "reactElement"] ),
218+
| ["ReasonReact"; "reactElement"]
219+
| [("Pervasives" | "PervasivesU"); "Jsx"; "element"] ),
219220
[] ) ->
220221
{dependencies = []; type_ = EmitType.typeReactElement}
221222
| (["FB"; "option"] | ["option"]), [paramTranslation] ->

0 commit comments

Comments
 (0)