We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given this: https://github.com/vasanthk/react-bits/blob/master/patterns/18.conditionals-in-jsx.md What about something like this:
const sampleComponent = () => { const basicCondition = flag && flag2 && !flag3; const obj = { 'flag4': 'Blah', 'flag5: 'Meh' }; if (basicCondition) { return <p>{obj[flagName] || Herp}</p> } return <p>Derp</p> };
The text was updated successfully, but these errors were encountered:
@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 cond from lodash in such a case ;)
cond
lodash
Sorry, something went wrong.
@cytrowski, honestly I didn't think about cond. Good idea, thanks!
No branches or pull requests
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: