Created
May 20, 2016 19:19
-
-
Save glcheetham/e0a16e2231075919458aefa791b8e23b to your computer and use it in GitHub Desktop.
React state with strategy pattern
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
// Example of a React state. Manage this with Flux, Redux, black magic, etc... | |
import AccountFields from '../Components/AccountFields' | |
import SurveyFields from '../Components/SurveyFields' | |
import Confirmation from '../Components/Confirmation' | |
let pages = [ | |
{"Title": "Account Fields", "ActiveComponent": React.createFactory(AccountFields) }, | |
{"Title": "Survey Fields", "ActiveComponent": React.createFactory(SurveyFields) }, | |
{"Title": "Confirmation", "ActiveComponent": React.createFactory(Confirmation) } | |
] | |
let state = pages[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment