New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about using an object? #82
Comments
@angelogulina nice :D Going further: const sampleComponent = () => {
const basicCondition = flag && flag2 && !flag3
const obj = {
'flag4': 'Blah',
'flag5: 'Meh'
}
return <p>{basicCondition ? obj[flagName] || Herp : Derp}</p>
} However I prefer using |
@cytrowski, honestly I didn't think about |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given this: https://github.com/vasanthk/react-bits/blob/master/patterns/18.conditionals-in-jsx.md
What about something like this:
The text was updated successfully, but these errors were encountered: