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

Viewed 15751

I have searched high and low, and I can find TypeScript equivalents for everything except React's PropTypes.node. I know that TypeScript doesn't need any PropTypes, but there are some PropTypes that I don't know how to convert to TypeScript.

Is it just as simple as var node: any? This doesn't seem right as node seems to have some properties.

3 Answers

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
}
Related