Add `index` property for steps
Closed this issue · 2 comments
wottpal commented
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
}
damianricobelli commented
In v3.1 an index is added to the current step. I can definitely add this
wottpal commented
Oh sweet, yes that works perfectly fine. Didn't see this release yet.