Skip to content

Remote selection hydration

Remote pages are not a complete record cache. The component tracks selection identities separately from the rows available for rendering or output.

If a form initializes from IDs which are not on the current page, provide full records through hydrationRows (for example, load them using a dedicated batch-by-ID endpoint).

<LookupSelect
dataSource={loadParts}
columns={columns}
mapper={mapper}
mode="multiple"
valueFormat="ids"
defaultValue={[42, 90]}
hydrationRows={previouslyLoadedParts}
returnShape="row"
onChange={rows => save(rows)}
/>

An identity that has no available row is pending. Full-row and custom outputs require all selected rows to be hydrated before confirmation. An ID/text output can also use a supplied label from valueFormat="id-text" when its row is unavailable. A bare pending ID without text cannot be mapped to an ID/text pair.

The default footer exposes a way to clear pending selections. Custom footers must respect canConfirm, confirmationDisabledReason and onClearPending. The trigger may show a pending selection count; onSelectionChange only contains hydrated rows.

Hydration is not a replacement for a server-side lookup by ID. The library uses rows supplied by the consumer, local data or loaded pages; it does not automatically fetch missing IDs.