href ='' 안에 아래 예시처럼 작성 시 노란색 밑줄과 동시에 오류가 발생한다class Toc extends Component {
render() {
return (
<nav>
<ul>
<li>
<a href="#">HTML</a>
</li>
<li>
<a href="javascript:;">CSS</a>
</li>
<li>
<a href="javascript:void(0)">JavaScript</a>
</li>
</ul>
</nav>
);
}
}
The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.mdeslintjsx-a11y/anchor-is-valid
<a href="#!">해결 방법 1</a>
<a href="{()=>false}">해결 방법 2</a>