Files
DefinitelyTyped/types/react-albus/react-albus-tests.tsx
Sindre fa96e1d7a3 added react-albus (#27300)
* added react-albus

* react-albus: fix lint errors
2018-07-15 12:31:54 -07:00

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>
)}
/>
);