Skip to content

Conversation

@matand-dd
Copy link

Make it possible to interrupt the handleStep to navigate to next step.

@devrnt
Copy link
Owner

devrnt commented Oct 26, 2021

Hi, thank you very much for this PR.

As far as I can see this functionality is already baked in, however by using try/catch, see https://github.com/devrnt/react-use-wizard/blob/main/src/wizard.tsx#L57-L66. Also, see the test cases here.

Feel free to reply if you have any comments or questions

@lucapollani
Copy link

Is there a release date also for this by chance?
Thanks

@justsaul
Copy link

justsaul commented Oct 3, 2022

Are there any plans to support such functionality? @devrnt

Edit: I feel like that this need encapsulates two problems:

  1. Throwing error within handler just for the sake of stopping nextStep() feels counter intuitive.
  2. Actual handling of such error that has been thrown from handleStep() is not documented at all. Yes, it is easy to make the connection between handleStep() and nextStep(), however, it would help a lot if it were to be documented.

@devrnt
Copy link
Owner

devrnt commented Dec 8, 2022

  1. Throwing error within handler just for the sake of stopping nextStep() feels counter intuitive.

Indeed, this feels a bit off at the moment

  1. Actual handling of such error that has been thrown from handleStep() is not documented at all. Yes, it is easy to make the connection between handleStep() and nextStep(), however, it would help a lot if it were to be documented.

You're right, there is only one mention in the docs at the moment, are you willing to pick this up?

@algooru
Copy link

algooru commented Apr 30, 2023

You're right, there is only one mention in the docs at the moment, are you willing to pick this up?

I am willing to pick this up.

@xucongli1989
Copy link

I am also looking at this feature.

@giacomocerquone
Copy link

giacomocerquone commented Sep 22, 2023

I've noticed this pr only after leaving the following comment (which is weirdly not linked): #74 (comment)

I gotta say that throwing is perfectly fine, it just needs a mention on the docs but I feel like creating a new paragraph about that wasn't super effective. It should be mentioned in the props table: https://github.com/devrnt/react-use-wizard#props

Furthermore, please @devrnt close this pr and the issue attached since it's been managed somehow

@devrnt
Copy link
Owner

devrnt commented Feb 19, 2024

Closing because already possible with the current API

@devrnt devrnt closed this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants