What is the type of the children prop in React and TypeScript?
Hi everyone! I recently started learning TypeScript with React and encountered a confusing situation. I'm creating a wrapper component that should accept child elements. In regular JavaScript, I just wrote `props.children` and it worked. But in TypeScript, I need to specify types, and I don't understand what type to specify for `children`.
Here's an example of my code:
```tsx
interface CardProps {
title: string;
children: ???; // What to write here?
}
function Card({ title, children }: CardProps) {
return (
);
}
```
I tried writing `children: any`, but that's not very good, type safety is lost. I tried `children: ReactNode` — it seems to work, but
{title}
{children}