mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 04:00:33 +08:00
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import * as React from "react";
|
|
import { Wizard, Step, Steps } from "react-albus";
|
|
|
|
const Example = () => (
|
|
<Wizard
|
|
onNext={wiz => {
|
|
wiz.go(0);
|
|
const location = wiz.history.location;
|
|
wiz.next();
|
|
wiz.previous();
|
|
wiz.push("merlin");
|
|
wiz.replace(wiz.step.id);
|
|
wiz.steps.map(step => {
|
|
wiz.push(step.id);
|
|
});
|
|
}}
|
|
render={wiz => (
|
|
<Steps>
|
|
<Step
|
|
id="merlin"
|
|
render={() => (
|
|
<div>
|
|
<h1>Merlin</h1>
|
|
<button onClick={() => wiz.next()}>Next</button>
|
|
</div>
|
|
)}
|
|
/>
|
|
<Step
|
|
id="gandalf"
|
|
render={stepWiz => (
|
|
<div>
|
|
<h1>Gandalf</h1>
|
|
<button onClick={() => stepWiz.next()}>Next</button>
|
|
<button onClick={() => stepWiz.previous()}>
|
|
Previous
|
|
</button>
|
|
</div>
|
|
)}
|
|
/>
|
|
<Step
|
|
id="dumbledore"
|
|
render={({ previous }) => (
|
|
<div>
|
|
<h1>Dumbledore</h1>
|
|
<button onClick={previous}>Previous</button>
|
|
</div>
|
|
)}
|
|
/>
|
|
</Steps>
|
|
)}
|
|
/>
|
|
);
|