Skip to content

Visitor callback element argument is typed incorrectly in TypeScript #86

Open
@TheSonOfThomp

Description

@TheSonOfThomp

The Flow type definition of the element argument is found in src/element.js:

export type UserElement = {
  type: ComponentType<DefaultProps> & ComponentStatics,
  props: DefaultProps,
  $$typeof: typeof REACT_ELEMENT_TYPE
}

In scripts/react-ssr-prepass.d.ts this type is mapped to React.ElementType<any>. However, the type defined above more accurately would be mapped to React.ReactElement<any> (see @types/react)

Metadata

Metadata

Assignees

No one assigned

    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