Next.js - How to call component’s getInitialProps in Layout
1 min readJan 8, 2020
It’s possible call getInitialProps in layout? this answer it’s nope. But you need change method when you want load something in yout layout.
In my application i want to read cookie for all page but just once how it’s work? concept using custom app.
first u need create custom app, bypass props to your layout and read in your layout
next call as props in layout
this full code you can read here :
Thank’s