Skip to content

Commit 4616e98

Browse files
committed
docs: simplify example in readme
1 parent 3151ff6 commit 4616e98

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

README.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const App = () => (
4242
const 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
9192
const 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

11696
const App = () => {
11797
return (

0 commit comments

Comments
 (0)