Problem Statement
Best type for children?
Explanation
children can be strings, numbers, elements, fragments, portals, or arrays. ReactNode covers these cases. JSX.Element is too narrow.
Code Solution
SolutionRead Only
import { ReactNode } from 'react';
type BoxProps = { children?: ReactNode };
function Box({ children }: BoxProps){ return <div>{children}</div>; }