DEV Community

Discussion on: Next.js E-Commerce Tutorial: SPA Example

Collapse
 
monfernape profile image
Usman Khalil

I recently worked on a similar stuff but struggled with header. How do we make header dynamic? I wanted to display different options to logged in user but NEXT won't rerender the layout again.

Collapse
 
pierreguillaumelaurin profile image
Pierre-Guillaume Laurin

Hi Usman,

Depending on your use case, you could use hooks in your custom App component and then pass them to your header, or shallow routing to change your route's query parameter and then, here also, pass them to your header.

Let me know how it goes!