Skip to content

resolveComponentContributions

resolveComponentContributions<TComponent, TProps>(props): ResolvedComponentContribution<TComponent, TProps>[]

Defined in: packages/core/src/components/resolve.ts:38

Orders one slot’s additive contribution list — hide directives applied, duplicate real ids rejected, order/before/after resolved into a final sequence.

Processing order: (1) partition hide directives from real contributions; (2) drop every real contribution whose id a hide directive names (S4’s “replace = hide + add” rule — a hide directive matching nothing is a harmless no-op, not an error, since a project may hide a built-in that a future core version removes outright); (3) among the SURVIVING real contributions, a repeated id IS an error (two genuine contributions fighting for one id, S9); (4) stable-sort by order (default 0), tie-broken by original array position; (5) apply before/after as a secondary topological pass over that stable order — a constraint naming an id that was hidden or never existed is ignored (the constraint is about relative position among what’s actually rendered).

TComponent extends ComponentHKT

TProps

ComponentContributionInput<TComponent, TProps>[]

SlotId

ResolvedComponentContribution<TComponent, TProps>[]

The final ordered list of resolved contributions.

When two real (non-hidden) contributions in props.contributions share one id.