Skip to content

Commit 20b7978

Browse files
committed
docs: add step index in next and previous step
1 parent 74506fe commit 20b7978

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ Used to retrieve all methods and properties related to your wizard. Make sure `W
112112

113113
`handleStep` is used to attach a handler to the step, can either be `async` or a `sync` function. This function will be invoked when calling `nextStep`.
114114

115+
Provide an optional `stepIndex` to either `nextStep` or `previousStep` to overwrite the default "step-flow" behaviour.
116+
115117
**Remark** - You can't use `useWizard` in the same component where `Wizard` is used.
116118

117119
#### Methods
118120

119121
| name | type | description |
120122
| ------------ | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
121-
| nextStep | () => Promise<void> | Go to the next step |
122-
| previousStep | () => void | Go to the previous step |
123+
| nextStep | (stepIndex?: number) => Promise<void> | Go to the next step. Overwrite the default behaviour by providing a step index |
124+
| previousStep | (stepIndex?: number) => void | Go to the previous step. Overwrite the default behaviour by providing a step index |
123125
| handleStep | (handler: Handler) => void | Attach a callback that will be called when calling `nextStep`. `handler` can be either sync or async |
124126
| isLoading | boolean | \* Will reflect the handler promise state: will be `true` if the handler promise is pending and `false` when the handler is either fulfilled or rejected |
125127
| activeStep | number | The current active step of the wizard |

0 commit comments

Comments
 (0)