Problem Statement
Props that may contain children are commonly typed with…
Explanation
Use PropsWithChildren<P> when your component accepts children. It safely adds an optional children: ReactNode to your props without you writing it by hand.
Code Solution
SolutionRead Only
import { PropsWithChildren } from 'react';
type CardProps = PropsWithChildren<{ title: string }>
function Card({ title, children }: CardProps) {
return (<section><h2>{title}</h2>{children}</section>);
}