Skip to content

App Bridge React 4: NavigationMenu → NavMenu (+ prop changes) #12

@mohab-sameh

Description

@mohab-sameh

Component renamed with different usage (children links instead of props). https://shopify.dev/docs/api/app-bridge/migration-guide

Before

import {NavigationMenu} from '@shopify/app-bridge-react';

<NavigationMenu
  navigationLinks={[
    {label: 'Home', destination: '/'},
    {label: 'Settings', destination: '/settings'},
]}/>

After

import {NavMenu} from '@shopify/app-bridge-react';

<NavMenu>
  <a href="/" rel="home">Home</a>
  <a href="/settings">Settings</a>
</NavMenu>

Detect:

  • Import/JSX of NavigationMenu.
  • Props navigationLinks/matcher.

Edge cases:

  • First child must be the home route (rel="home"); ensure it exists.

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    app-bridge-reactApp Bridge React transformationsbreaking-changeBreaking change requiring migration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions