ClientRouter

By default, App Bridge applies URL changes from outside your app, such as changes from a navigation item being clicked, by updating the iframe URL. If your app uses client-side routing, such as React Router, then you need to override this behaviour to avoid unnecessary full-page reloads.

ClientRouter prevents App Bridge from changing the iframe URL, and lets you provide a client-side router, for example react-router, to handle navigation.

You can use ClientRouter as a hook (useClientRouting) or a component (<ClientRouter />).

ClientRouter can be used with any routing system that provides a history.replace method, which accepts a string for the updated path: