react-ssr-prepass
react-ssr-prepass copied to clipboard
`Visitor` callback `element` argument is typed incorrectly in TypeScript
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)