MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getStepIndex

Function getStepIndex

packages/react-aria-components/src/Wizard.tsx:369–371  ·  view source on GitHub ↗
(collection: ICollection<Node<T>>, key: Key | null)

Source from the content-addressed store, hash-verified

367
368// The position of a step within the wizard, or -1 if the key isn't one of its steps.
369function getStepIndex<T>(collection: ICollection<Node<T>>, key: Key | null): number {
370 return key != null ? (collection.getItem(key)?.index ?? -1) : -1;
371}
372
373function WizardInner({props, collection, tabsRef}: WizardInnerProps) {
374 let {

Callers 2

useWizardStateFunction · 0.85
useWizardStepFunction · 0.85

Calls 1

getItemMethod · 0.65

Tested by

no test coverage detected