DEV Community

loading...

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

Collapse
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: react-cn.github.io/react/tips/if-e...