-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendered @shopify/app-bridge-react
modal src does not have an environment
set
#315
Comments
Modal src has to communicate with the main app for all App Bridge features. Modal is just a presentation layer. |
If that's the case it sounds like the instance of app bridge rendered within |
@jasong689 It's fixed. |
@meecrobe you should be able to get a toast working from inside the Modal src with this code:
And it also works for the ResourcePicker: |
Describe the bug
If you set the
src
ofModal
from@shopify/app-bridge-react
to another route within your embedded app, the AppBridge that is returned fromuseAppBridge
from that context has anundefined
value forshopify.environment
.To Reproduce
Steps to reproduce the behaviour:
In an embedded app using app bridge v4 and
@shopify/app-bridge-react
v4.1.1Modal
component from@shopify/app-bridge-react
in the root of the embedded appsrc
prop of theModal
to/
useAppBridge
hook from@shopify/app-bridge-react
to return an instance of app bridgeshopify.environment
shopify.environment
within the modal's iframe is undefinedIf applicable, add screenshots to help explain your problem.
Expected behaviour
The values for
shopify.environment
should be the same between the embedded app and the modal.Contextual information
Packages and versions
List the relevant packages you’re using, and their versions. For example:
@shopify/app-bridge-react
@4.1.1
Platform
Additional context
Add any other context about the problem here, such as your app’s configuration (Node, Next.js, Rails).
The text was updated successfully, but these errors were encountered: