Next.js Discord

Discord Forum

Fast Refresh not working with client component and window.location

Answered
Raymond posted this in #help-forum
Open in Discord
In my client component I'd have something like const test = window.location, then the page that uses this component won't have Fast Refresh. Rather, any dev changes will cause the page to fully refresh. Is this expected behavior?
Answered by Raymond
Nvm I'm using it incorrectly, it should have href="/" rather than window.location.origin
View full answer

2 Replies

I intended to use window.location.origin for my logo such that if you press it, it'll bring you to the home page
Nvm I'm using it incorrectly, it should have href="/" rather than window.location.origin
Answer