What is the TypeScript equivalent of React.PropTypes.node?
Use React.ReactNode
for React.PropTypes.node
type
TypeScript for React developer
In Typescript, it has the checked type React.ReactNode
which work the same as React.PropTypes.node
in prop-types.
eg:
export interface PersonProps {
children: (name: string, age: number) => React.ReactNode
}
You could use JSX.Element
, which is what I believe JSX itself resolves to.