Skip to content

Invalid .resi generated #7443

Open
Open
@cknitt

Description

@cknitt

This was observed in v11:

If I have a component Test.res with the following code:

@react.component
let make = (~size=#large) => {
  let className = switch size {
  | #large => "text-lg"
  | #small => "text-sm"
  }

  <div className />
}

and I generate a .resi from it in VS Code, I get

@react.component
let make: (~size: [< #large | #small large]=?) => Jsx.element

which is invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions