render prop

A prop whose value is a function the component calls to decide what to display, passing in its internal data.

In more detail

For example, <MouseTracker render={(pos) => <Cursor at={pos} />} /> shares the mouse position while the caller controls the markup. Custom hooks now handle most logic sharing, but render props remain useful when a parent must let callers render parts of its layout.

Related terms

Taught in

References