Skip to content

React Router Links and MenuItems #142

@athurman

Description

@athurman

ran into issues with trying to wrap MenuItems in react-router Links and vice-versa. Link components do not play nice with MenuItem components, because they are both rendered as a tags in the dom, here is how it looks when elements are rendered:

<a class="sd-menu-item Sidebar-linkIcon item active" data-reactid=".0.0.$=1$/=010.$=11.$link-3/=1$link-3">
  ::before
</a>
<a class="" href="/users" data-reactid=".0.0.$=1$/=010.$=11.$link-3/=1$link-3.2">
  <i class="users icon" data-reactid=".0.0.$=1$/=010.$=11.$link-3/=1$link-3.2.0"></i>
  <span class="Sidebar-linkText" data-reactid=".0.0.$=1$/=010.$=11.$link-3/=1$link-3.2.1">
    USERS
  </span>
</a>

this causes issues with styling, and breaks behaviors with MenuItem

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions