You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error Anchor used as a button. Anchors are primarily expected to navigate. Use the button element instead. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid
Expected Behavior
ESLint shouldn't throw the error.
Steps to Reproduce
See the code above
Environment
node 16.13
react 17.0.2
Additional Context
It is of course possible to use ESLint directive to prevent this error:
/* eslint-disable jsx-a11y/anchor-is-valid */
I have also noticed that if a non-empty attribute href or to is specified, the error is not thrown. However, the attribute has no function there (the onClick handler is used) and it is confusing to have it there.
The text was updated successfully, but these errors were encountered:
Describe the Bug
When I use Link as Button in the following code:
ESLint throws error:
Expected Behavior
ESLint shouldn't throw the error.
Steps to Reproduce
See the code above
Environment
Additional Context
It is of course possible to use ESLint directive to prevent this error:
I have also noticed that if a non-empty attribute
href
orto
is specified, the error is not thrown. However, the attribute has no function there (the onClick handler is used) and it is confusing to have it there.The text was updated successfully, but these errors were encountered: