Skip to content

JSXv4: Nested component definitions yields confusing error #5975

Closed
@glennsl

Description

@glennsl

Repro

module Outer = {
  @react.component
  let make = () => {
    module Inner = {
      @react.component
      let make = () => <div />
    }

    <Inner />
  }
}

causes the error:

React: props need to be labelled arguments.
  If you are working with refs be sure to wrap with React.forwardRef.
  If your component doesn't have any props use () or _ instead of a name.

without any location information.

This used to work in JSX v3.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions