EN
React - Using target="_blank" without rel="noreferrer" warning
1
answers
0
points
Hello, today I've been coding some React components, and I ran into the warning below. How can make it stop showing me this warning?
Warning:
Line 16:7: Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations react/jsx-no-target-blank
My code:
const MyFooter = () => {
return (
<div className="MyFooter">
<a href="https://www.youtube.com/channel/UCXyQaRr4I7wIwtRSrFdyDnA" target="_blank"></a>
</div>
);
};
export default MyFooter;
1 answer
0
points
You have to add rel="noreferrer"
to the <a>
element to fix it.
Your code should look like:
const MyFooter = () => {
return (
<div className="MyFooter">
<a href="https://www.youtube.com/channel/UCXyQaRr4I7wIwtRSrFdyDnA" target="_blank" rel="noreferrer"></a>
</div>
);
};
export default MyFooter;
For more information go to the following article:
0 comments
Add comment