Replies: 1 comment
-
The documentation itself is fine as it doesn't show a You can't pass everything onto the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm following the official documentation on adding a layout using
wrapPageElement
:https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/#wrapPageElement
I'm getting errors in the console regarding
pageResources
,pageContext
, andnavigate
.The same thing happens when using
gatsby-plugin-layout
instead of configuring it manually.Steps to reproduce
Create
gatsby-browser.js
. Note I'm using ES6 module format since the CommonJS format in the documentation doesn't appear to work:Create
src/layout/index.js
:This passes
props
via<Layout {...props}>
which is spread in Layout, causing errors in console.Expected result
I would expect the documented example to work without console errors.
Actual result
The following errors occur in the console when loading any page:
Workaround
I've been able to work around the problem by changing Layout to this. I don't yet know if this will cause any other issues with page navigation, etc:
Environment
Beta Was this translation helpful? Give feedback.
All reactions