arrow_backBACK TO DRILLS
Black BeltecosystemlockPREMIUM

Typing JSX Children to Allow Only HTML Elements

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?

lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.