In gatsby is their is a way to Prevent Layout from reloading along with the page. #38926
Usama-Malik9
started this conversation in
Community
Replies: 1 comment
-
Hi, You can also use the NB : If some sub components of your global layout depends on page context data, location states, you should also wrap this with a React Context, a redux store or whatever. |
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.
-
So, Every time I click on the links in my navbar a new page renders, therefore re-rendering the Layout component inside those pages,
but how do I prevent that form happening? I want the layout component to render once because I have animations on the title and icons.
I used this as well in gatsby-browser.ts file but layout always reloads with the page.
import React from "react";
import CheckerLayout from '../layouts/checker-layout'
export const wrapPageElement=({element,props})=>(
<CheckerLayout {...props}>{element}
)
Beta Was this translation helpful? Give feedback.
All reactions