Skip to content

SkeletonProps

SkeletonProps<T> = SkeletonBase & { children?: ReactNode | SkeletonRenderProp<T>; data?: T; root?: "auto"; } | { children: SkeletonRenderProp<T>; data?: T; root: "manual"; }

Defined in: react.core.tsx:197

Props accepted by the React <Skeleton> component, generic over the optional render-prop data payload T (ADR 0014). The generic defaults to undefined so existing call sites — <Skeleton plate loading />, plain children — keep working with zero type arguments; passing data infers T into the render prop. data is a pure pass-through (the consumer owns nullability), never NonNullable<T>.

The two members discriminate on root:

  • root="auto" (default): the existing display:contents boundary wrapper marks the capture seam (ADR 0006); children may be plain ReactNode OR a render prop, and the surfaced ref is a no-op.
  • root="manual": no wrapper; the consumer owns the capture root element. This REQUIRES render-prop children (the only way to hand back the ref that writes the boundary marker), so plain children + root="manual" is a type error.

T = undefined