damianricobelli/stepperize

Add `index` property for steps

Closed this issue · 2 comments

It's useful to get an (automatic) index value for each step, e.g. when showing something like "Step {index} of {total}".

Currently I'm using a small helper function like:

function getStepIndex(step: (typeof steps)[number]) {
  return steps.findIndex((_step) => step.id === _step.id) as number
}

In v3.1 an index is added to the current step. I can definitely add this

Oh sweet, yes that works perfectly fine. Didn't see this release yet.