Edit in GitHubLog an issue

Router

The Peregrine Router is a client-side router that is designed to understand the different storefront routes within Magento 2. If using Peregrine to bootstrap your PWA, it is configured automatically. If not, the Router can be manually consumed.

Props

NameRequiredDescription
apiBase
Yes
Root URL of the Magento store (including protocol and hostname)
using
No
Router implementation from React-Router. Possible values: BrowserRouter, HashRouter, MemoryRouter
routerProps
No
Any additional props to pass to React-Router

Example

The following example shows the manual usage of the Router component:

Copied to your clipboard
import ReactDOM from "react-dom";
import { Router } from "@magento/peregrine";
ReactDOM.render(
<Router apiBase="https://mystore.com" />,
document.querySelector("main")
);
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.