hypothesis / frontend-shared

UI components and styles for Hypothesis front-end applications
https://patterns.hypothes.is
5 stars 2 forks source link

Pattern library contains nested `<a>` for navigation links #1668

Closed robertknight closed 4 weeks ago

robertknight commented 4 weeks ago

Steps to reproduce:

  1. Go to https://patterns.hypothes.is
  2. Observe errors in the console
Improper nesting of interactive content. Your <a> should not have other anchor tags as child-elements.<a onClick="function () {}" href="/lms-content-selection" className="undefined" />

  in a
  in  (at /frontend-shared/src/pattern-library/components/PlaygroundApp.tsx:65)
  in NavLink (at /frontend-shared/src/pattern-library/components/PlaygroundApp.tsx:202)
  in PlaygroundApp (at /frontend-shared/src/pattern-library/index.tsx:44)

The NavLink component contains a <Link> wrapped in a <RouteLink> and both render <a> tags.