Skip to content

Support of button attributes on MainNavigation #38

@enguerranws

Description

@enguerranws

On MainNavigation component, a navigation item is rendered as a <Link> element if linkProps has been set, otherwise, it's rendered as a <button>.

The use case is that we use id attribute (tracking, e2e testing, etc.). It's possible on items using linkProps, but not if linkProps is not used.

{
      text: "Nav item as <button>",
      isActive: isNavItemActive,
      //id: "not-working-id",
      menuLinks: [
        {
          text: "Sub nav item",
          linkProps: {
            ...routes.myRoute().link,
            id: "my-working-link-id",
          }
        },

Should we add a buttonProps in MainNavigationProps.Item that satisfies React.HTMLProps<HTMLButtonElement> ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions