Next.js Discord

Discord Forum

Refetch headers in server component on redirect

Answered
Dwarf Crocodile posted this in #help-forum
Open in Discord
Dwarf CrocodileOP
I'm trying to read the headers in my layout using the headers() function but when I redirect with a Link or an anchor headers().get("referer") doesn't update.
Answered by Dwarf Crocodile
I moved the condition to a client component
View full answer

2 Replies

Dwarf CrocodileOP
Is this a cache issue?
Dwarf CrocodileOP
I moved the condition to a client component
Answer