Skip to content

JSX: error with fragment after fixing children type #6234

Closed
@cknitt

Description

@cknitt

rescript-lang/rescript-react#94 fixes the children type for <>, React.Fragment, React.StrictMode and React.Suspense by making it React.element instead of 'children.

This causes an issue with <>:

<>
  <A />
  <B />
</>

now gives the following error without location:

This has type: array<'a>
  Somewhere wanted: React.element (defined as JsxU.element)

The components React.Fragment, React.StrictMode and React.Suspense still work fine though, so it seems there is some special handling for <> in the PPX that needs to be adapted.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions