-
- Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
Code
const openInNewTab = true; // could be true or false export default function App() { return ( <a href="https://google.com" target={openInNewTab ? "_blank" : "self"} rel={openInNewTab ? "noreferrer" : undefined} > Open Google </a> ); }
Currently what's happening
If I pass target='_blank'
based on some condition as shown in the above snippet, and pass rel='noreferrer'
on same condition. It is still showing me warning/error as per the config.
What should happen?
Ideally if the condition is same for both the props it should recognise it and should not give us warning/error.
Please let me know if I am missing something?
Reference:
Sample Codesandbox - https://codesandbox.io/s/mystifying-lake-l0420z?file=/src/App.js