Conditional Statements
Nested conditions in JSX
- I am checking if
YoutubeLink
isnull
and if it isnull
then if theTwitterLink
exists.
{item.data.YoutubeLink !== null ? (
<Youtube link={item.data.YoutubeLink} />
) : (
[
item.data.TwitterLink !== null ? (
<Twitter link={item.data.TwitterLink} />
) : (
<FeedbackImage
link={item.data.SheroesLInk}
imageUrl={item.data.Attachments[0].url}
/>
),
]
)}