class Example extends Component {
routes = [
{
'Shipping': () => <ExampleComponent message="Test #1" />,
'nextAction': () => this.doSomething('hello world!'),
'previousAction': () => this.doSomething('back to previous view #1')
},
{
'Payment': () => <ExampleComponent message="Test #2" />,
'nextAction': () => this.doSomething('hello world #2!'),
'previousAction': () => this.doSomething('back to previous view #2')
},
{
'Confirm': () => <ExampleComponent message="Test #3" />,
'nextAction': () => this.doSomething('hello world #3!'),
'previousAction': () => this.doSomething('back to previous view #3')
}
];
customStyle = {}
doSomething(text = 'do something...') {
console.log(text);
}
render() {
return (
<View>
<Steps stepsStyle={customStyle}
steps={this.routes} />
</View>
);
}
}