jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
583 stars 126 forks source link

Add current named step on step change callback #94

Open ayresflesch opened 3 years ago

ayresflesch commented 3 years ago

I was wondering if there's a way to add the active named step to the stats object used on step change callback.

https://github.com/jcmcneal/react-step-wizard/blob/c2b944808aac2f777f2f780b639d9ba70923e8fe/src/index.js#L114-L123

Something like this, I guess:

// Step change callback
this.onStepChange({
    previousStep: active + 1,
    activeStep: next + 1,
    activeNamedStep: // get named step
});