3 ms·
It would look a lot better using proper identation... <div> {flag && flag2 && !flag3 ? flag4 ? <p>Blah</p> : flag5 ?
by ht85 9y ago
It would look a lot better using proper identation...
<div>
{flag && flag2 && !flag3
? flag4
? <p>Blah</p>
: flag5
? <p>Meh</p>
: <p>Herp</p>
: <p>Derp</p>
}
</div>
Should be:
<div>
{ flag && flag2 && !flag3
? flag4
? <p>Blah</p>
: flag5
? <p>Meh</p>
: <p>Herp</p>
: <p>Derp</p>
}
</div>
- andreasklinger 9y agonesting ternaries isnt a thing that should be done this example should just be using early returns imo added a PR: https://github.com/vasanthk/react-bits/pull/76/files https://github.com/vasanthk/react-bits/pull/76/files