Flow recently added a type system feature which allows to restrict children by component type called Render Types
component Header(size: string, color: string, message: string) {
return <h1 style={{color}}>{message}</h1>;
}
component Layout(header: renders Header) {
return <div>{header}</div>;
}
Does rescript type system allows that already?