react component typescript return type code example Example: type a passed component typescript react interface ParentCompProps { childComp?: React.ReactNode; }