FormidableLabs / FormidableLabs/react-ssr-prepass
`Visitor` callback `element` argument is typed incorrectly in TypeScript
Open
- Dominant language
- JavaScript
- Stars
- 603
- Forks
- 26
- PR merge metrics
- No merged PRs in 30d
Description
The Flow type definition of the `element` argument is found in `src/element.js`:
```js
export type UserElement = {
type: ComponentType & ComponentStatics,
props: DefaultProps,
$$typeof: typeof REACT_ELEMENT_TYPE
}
```
In `scripts/react-ssr-prepass.d.ts` this type is mapped to `React.ElementType`. However, the type defined above more accurately would be mapped to `React.ReactElement` (see [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L151-L155))
Contributor guide
Assessment
This issue has not been assessed yet.