In a React app
Person Link
results in the following eslint error
The href attribu
The Link
component generates href
attribute so in the end anchor tag is valid from the accessibility point of view. Add an exception to .eslintrc
:
{
"rules": {
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "Link" ],
"specialLink": [ "to" ]
}]
}
}
Additionally, there is the same issue with a answer on GitHub.
Perhaps you meant to put backticks instead of single-quotes in order to create a template literal. Try the following:
<Link to={`/person/${this.state.id}/edit`}>Edit</Link>
you can just write some text content inside the "a" tag and hide it with CSS (font-size:0px or something