react-use-wizard icon indicating copy to clipboard operation
react-use-wizard copied to clipboard

feat: check handle step.

Open matand-dd opened this issue 4 years ago • 2 comments

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

matand-dd avatar Oct 13 '21 07:10 matand-dd

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

devrnt avatar Oct 26 '21 20:10 devrnt

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

lucapollani avatar Apr 13 '22 10:04 lucapollani

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.

justsaul avatar Oct 03 '22 15:10 justsaul

  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?

devrnt avatar Dec 08 '22 17:12 devrnt

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.

algooru avatar Apr 30 '23 20:04 algooru

I am also looking at this feature.

xucongli1989 avatar Sep 02 '23 10:09 xucongli1989

I've noticed this pr only after leaving the following comment (which is weirdly not linked): https://github.com/devrnt/react-use-wizard/issues/74#issuecomment-1731210574

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

giacomocerquone avatar Sep 22 '23 10:09 giacomocerquone

Closing because already possible with the current API

devrnt avatar Feb 19 '24 20:02 devrnt