gotToStep() fails with dynamically rendered step
nathanlepori opened this issue · comments
See repro:
https://codesandbox.io/embed/clever-cloud-tigmwb?fontsize=14&hidenavigation=1&theme=dark
After clicking "Add step" it's not possible to navigate to step "four". Step count is not correctly set inside goToStep().
nextStep() and previousStep() work fine.
This is indeed an issue, thanks for reporting.
The issue is that https://github.com/devrnt/react-use-wizard/blob/main/src/wizard.tsx#L32-L47 is stale and won't update if the stepCount
changes