The If-Else in JSX page only offers up ternary expressions as a solution to conditional logic inside JSX. But perhaps IIFEs should also get a mention?
Realizing I could do IIFEs inside JSX helped "flesh out" my mental model of how JSX actually works, so I suspect it would aide others in the same way as well. Furthermore, with the advent of ES6 arrow functions, they aren't too verbose either.
A code example utilizing an IIFE might be overkill, but at least a passing mention would be nice.
The
If-Else in JSXpage only offers up ternary expressions as a solution to conditional logic inside JSX. But perhaps IIFEs should also get a mention?Realizing I could do IIFEs inside JSX helped "flesh out" my mental model of how JSX actually works, so I suspect it would aide others in the same way as well. Furthermore, with the advent of ES6 arrow functions, they aren't too verbose either.
A code example utilizing an IIFE might be overkill, but at least a passing mention would be nice.