File tree Expand file tree Collapse file tree 1 file changed +3
-23
lines changed Expand file tree Collapse file tree 1 file changed +3
-23
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const App = () => (
4242const Step1 = () => {
4343 const { handleStep , previousStep , nextStep } = useWizard ();
4444
45- // Attach a handler
45+ // Attach an optional handler
4646 handleStep (() => {
4747 alert (' Going to step 2' );
4848 });
@@ -88,30 +88,10 @@ Example: pass a footer component that contains a "previous" and "next" button to
8888#### Example
8989
9090``` javascript
91+ // Example: show the active step in this component
9192const Header = () => < p> I am the header component< / p> ;
9293
93- const Footer = () => {
94- const {
95- nextStep ,
96- previousStep ,
97- activeStep ,
98- isLastStep ,
99- isFirstStep ,
100- } = useWizard ();
101-
102- return (
103- <>
104- < div>
105- Has next step: {! isLastStep ? ' ✅' : ' ⛔' }
106- < br / >
107- Has previous step : {! isFirstStep ? ' ✅' : ' ⛔' }
108- < / div>
109- Active step: {activeStep + 1 } < br / >
110- < button onClick= {previousStep}> Previous< / button>
111- < button onClick= {nextStep}> Next< / button>
112- < / >
113- );
114- };
94+ const Footer = () => < p> I am the footer component< / p> ;
11595
11696const App = () => {
11797 return (
You can’t perform that action at this time.
0 commit comments