Skip to content

Conversation

jasong689
Copy link
Contributor

@jasong689 jasong689 commented Oct 4, 2022

If a custom router is passed to the Provider we should use that to determine any query params in the URL (for things like host). This will work better for technologies like Next that may have a SSR component and have a custom router. This would allow you to do something like the following for Next:

const router = useRouter()

<GadgetProvider 
    type={AppType.Embedded}
    shopifyApiKey={process.env.NEXT_PUBLIC_SHOPIFY_API_KEY!} 
    api={api}
    router={{
        location: router.asPath,
        history: router
    }}>
...
</GadgetProvider>

Jason Gao added 2 commits October 3, 2022 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant