Input
User clicks next-btn on step 2 (validation pending), then clicks back-btn
Output
User is on step 1. When step 2 validation later resolves true, nothing happens — wizard stays on step 1.
A 3-step wizard has two production bugs. Bug 1: double-clicking "Next" fires validation twice and can jump two steps at once. Bug 2: clicking "Back" while validation is pending causes the stale result to silently advanc...
App.tsxEditable starterUser clicks next-btn on step 2 (validation pending), then clicks back-btn
User is on step 1. When step 2 validation later resolves true, nothing happens — wizard stays on step 1.
How would you extend this to support validation that can reject (throw an error), showing an error message on the current step without advancing or going back?