I have a react app and am trying to pass down a prop to a jsx element based on a condition. The element in question is an anchor tag and if the condition is true
I would like to pass a rel="noreferrer"
but if it is false I don’t want to pass down anything…
Like <a {...thisCondtion}
or something of that nature.
Is there a specific way to do this?
Assume the condition either renders true or null (&&
ternary) how would I pass down that prop correctly.