Skip to content

IIFE mention in "If-Else in JSX"? #4141

@lukehorvat

Description

@lukehorvat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions