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.
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!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
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!