Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visitor callback element argument is typed incorrectly in TypeScript #86

Open
TheSonOfThomp opened this issue Apr 21, 2023 · 0 comments · May be fixed by #87
Open

Visitor callback element argument is typed incorrectly in TypeScript #86

TheSonOfThomp opened this issue Apr 21, 2023 · 0 comments · May be fixed by #87

Comments

@TheSonOfThomp
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant