MCPcopy Index your code
hub / github.com/WebDevSimplified/react-multistep-form / next

Function next

src/useMultistepForm.ts:6–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4 const [currentStepIndex, setCurrentStepIndex] = useState(0)
5
6 function next() {
7 setCurrentStepIndex(i => {
8 if (i >= steps.length - 1) return i
9 return i + 1
10 })
11 }
12
13 function back() {
14 setCurrentStepIndex(i => {

Callers 1

onSubmitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected