Skip to content

Commit e4439c9

Browse files
committed
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
1 parent 2c67459 commit e4439c9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- Fix unused attribute check for `@as`. https://github.com/rescript-lang/rescript-compiler/pull/6795
3333
- Reactivate unused attribute check for `@int`. https://github.com/rescript-lang/rescript-compiler/pull/6802
3434
- Fix issue where optional labels were not taken into account when disambiguating record value construction. https://github.com/rescript-lang/rescript-compiler/pull/6798
35+
- Fix issue in gentype when type `Jsx.element` surfaces to the user. https://github.com/rescript-lang/rescript-compiler/pull/6808
3536

3637
#### :house: Internal
3738

jscomp/gentype/TranslateTypeExprFromTypes.ml

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env =
216216
{dependencies = []; type_ = EmitType.type_react_event_mouse_t}
217217
| ( ( ["React"; "element"]
218218
| ["ReactV3"; "React"; "element"]
219-
| ["ReasonReact"; "reactElement"] ),
219+
| ["ReasonReact"; "reactElement"]
220+
| [("Pervasives" | "PervasivesU"); "Jsx"; "element"] ),
220221
[] ) ->
221222
{dependencies = []; type_ = EmitType.type_react_element}
222223
| (["FB"; "option"] | ["option"]), [param_translation] ->

0 commit comments

Comments
 (0)