Created
November 8, 2018 11:40
-
-
Save cbrannen9a/4bfb465a1bca1a11c933431a92a2a37b to your computer and use it in GitHub Desktop.
Get step content with state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getStepContent = (step) => { | |
switch (step) { | |
case 0: | |
return <AddressForm | |
state={this.state} | |
handleChange={this.handleChange} | |
/>; | |
case 1: | |
return <PaymentForm state={this.state} | |
handleChange={this.handleChange} | |
/>; | |
case 2: | |
return <Review state={this.state} | |
handleChange={this.handleChange} | |
/>; | |
default: | |
throw new Error('Unknown step'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment