Created
September 26, 2020 14:33
-
-
Save surfer19/b37e42d7a473807cf58ad4d76a143520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useStep } from "react-hooks-helper"; | |
import { Step1 } from "./views/Step1"; | |
import { Step2 } from "./views/Step2"; | |
const steps = [{ id: "step1" }, { id: "step2" }]; | |
export const RegistrationFormStepper = () => { | |
const { step, navigation } = useStep({ initialStep: 0, steps }); | |
const props = { navigation }; | |
const { id } = step; | |
switch (id) { | |
case "step1": | |
return <Step1 {...props} />; | |
case "step2": | |
return <Step2 {...props} />; | |
default: | |
return <Step1 {...props} />; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment