I am working on a project in ReactJs.I have an array in javascript for which the values will come from the back-end.So, the length of the array will be dynamic.So, I want my UI to change if the array elements contain the string 'No Email Alerts'. So I am writing a map on my array components and trying to render it in the following way:
{this.state.options.map((email, i) => {
return (
<Something />
{!(email[i].includes('No Email Alerts')) ? (
<Some_Other_UI />
) :
null}
But, the issue I am facing now is I am not able to exclude the part which contains 'No Email Alerts' and render the different UI. I mean my
{!(email[i].includes('No Email Alerts')) ? (
<Some_Other_UI />
) :
null}
is not working. What am i doing wrong? Someone please guide me.
email[i]toemail