I am trying to obtain the following line
<a href="/users/users/authentication" rel='nofollow'>
Note the rel='nofollow'
Within the render method of my React component, I have this JSX syntax :
render() {
const rel = "rel='nofollow'";
return (
<div>
<a href="/users/users/authentication" {rel}>
</div>
);
}
I get a : Error: /~/Scripts/Navigation.jsx: Unexpected token, expected "..."
I also tried with
let rel = { __html: "<b>Hey</b>" };
and
<a href="/users/users/authentication" dangerouslySetInnerHTML={rel}>
which fails too but anyway dangerouslySetInnerHTML is supposed to inject some stuff between the opening and closing tag not within as an attribute of the tag.
What would be the correct JSX syntax to make that happen ?