-
Notifications
You must be signed in to change notification settings - Fork 64
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
next-apollo not forwarding static properties on components it wraps #74
Comments
Turns out this is not as trivial as I thought it would be. You can't simply pass Layout through, as layout might contain queries of its own and must be a part of the await getDataFromTree(
<Layout>
<AppTree {...props} />
</Layout>
); either. Trying to include it in the
when trying to do return (
<ApolloProvider client={client}>
<Layout>
<PageComponent {...pageProps} />
</Layout>
</ApolloProvider>
); Despite the layout being nested inside I'm surprised there's nothing about this with apollo in nextjs, dynamic layouts are something I use all the time in react so I'm a little concerned by how difficult it's being to implement with apollo (and how nobody else seems to be having the same problem). I realize this isn't a Of course if you're not fetching data inside a layout then none of this is relevant and you can simply forward it to |
Hey @Xetera - yeah I wish dynamic/persistent layouts had first-class support in next.js. There is a workaround though; check out this guide by Adam Wathan 👉 https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/ |
@Xetera Do you see any solutions now? |
If I'm not wrong, it's currently not possible to work with nested layouts in next-apollo because it doesn't forward the
Layout
property in an example liketo the
_app
page which is quite limiting. If this is something you are interested in supporting (and I don't see why not) I'm happy to open a PR for itThe text was updated successfully, but these errors were encountered: