Skip to main content

a11y/useAnchorContent

MISSING DOCUMENTATION

Examples

Invalid

<a />

 file.jsx:1 lint/a11y/useAnchorContent ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Provide screen reader accessible content when using anchor elements.

    <a />
    ^^^^^

  All links on a page should have content that is accessible to screen
    readers.


<a><TextWrapper aria-hidden /></a>

 file.jsx:1 lint/a11y/useAnchorContent ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Provide screen reader accessible content when using anchor elements.

    <a><TextWrapper aria-hidden /></a>
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  All links on a page should have content that is accessible to screen
    readers.

<a></a>

 file.html:1 lint/a11y/useAnchorContent ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Provide screen reader accessible content when using anchor elements.

    <a></a>
    ^^^^^^

  All links on a page should have content that is accessible to screen
    readers.

Valid

<a>Anchor Content!</a>
<a><TextWrapper /></a>
<a dangerouslySetInnerHTML={{ __html: 'foo' }} />
<a><TextWrapper aria-hidden={true} /> visible content</a>
<a>Anchor Content!</a>
<a><div aria-hidden="true"></div>visible content</a>