This page was printed on Dec 12, 2019. For the current version, visit https://help.shopify.com/en/api/embedded-apps/app-bridge/react-components.
Shopify App Bridge offers React component wrappers for some actions. This is a great option if you are already using React and want to follow familiar patterns.
Instead of using App Bridge actions directly:
Use the React component wrappers:
Using App Bridge with Polaris
App Bridge React is fully compatible with Polaris.
To use both together, wrap your app in both Polaris’s
<AppProvider> component as well as App Bridge React’s
Do not pass
shopOrigin to Polaris’s
Instead, pass the
config prop to App Bridge React’s
You can access the App Bridge client
app using the React Context API, as in Polaris.
<Provider> component for more information.