DEV Community


Discussion on: React - Cannot read property 'map' of undefined

alli profile image
Alli Teration

You can use an immediately-invoked function expression to add an if statement to JSX, but I don’t recommend it if a ternary or the && operator can be used. Link:

Forem Open with the Forem app