Skip to main content

Function: useInfraProps()

useInfraProps<P>(props): P & Partial<PropellerInfra>

Defined in: composables/react/useInfraProps.ts:31

useInfraProps — resolves the Tier 1 infrastructure props for a component.

  • An explicit prop value (defined and non-null) always wins — existing call sites keep working unchanged (additive / opt-in, no breaking change).
  • Otherwise the value is taken from <PropellerProvider>.
  • Non-infra props pass through untouched.
  • Null-context safe: with no provider the props are returned as-is, so components still work standalone / in tests.

Type Parameters

P

P extends Partial&lt;Record&lt;keyof PropellerInfra, unknown>>

Parameters

props

P

the component's raw props, possibly carrying infra keys.

Returns

P & Partial&lt;PropellerInfra>

the same props with any unset infra keys filled in from the provider.