What is the TypeScript equivalent of React.PropTypes.node? What is the TypeScript equivalent of React.PropTypes.node? reactjs reactjs

What is the TypeScript equivalent of React.PropTypes.node?


Use React.ReactNode for React.PropTypes.node type


You could use JSX.Element, which is what I believe JSX itself resolves to.


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}