zaguiini / formik-wizard

A multi-step form component powered by formik and react-albus
MIT License
86 stars 26 forks source link

GoToStep & onAction API call response error #24

Closed raghvendra141990 closed 4 years ago

raghvendra141990 commented 4 years ago

Hi, I was trying to use this in my project but I am stuck on 2 things.

1) I am not able to go to a particular step. it always starts from the beginning. Please do let me know if any solution for that.

2) onAction call if any error in API response how to handle that.

zaguiini commented 4 years ago
  1. FormikWizard exposes a prop called albusProps which you can use to pass props directly to the underling <Wizard /> component. Also, in the FormikWizardContext (useFormikWizard()) you also get access to the wizard object, which is the react-albus context itself.

  2. I didn't quite get it.

ataravati commented 4 years ago

@aneraghu If there are any errors in the API response just catch it and then throw it again. If you don't throw the error the wizard goes to the next step, which in most cases is not what you want.