arrow_backBACK TO DRILLS
Black BeltecosystemPREMIUM
TypeScript Cannot Constrain JSX Children to Plain HTML Elements Only
A developer wants a component's children prop typed so that only plain HTML elements like <p> or <span> are accepted, rejecting custom React components as children.
Why is this constraint impossible to express in TypeScript's type system, regardless of how the children prop is typed?