Remix: ways around window undefined episode artwork

EPISODE · Sep 13, 2022 · 5 MIN

Remix: ways around window undefined

from The Call Kent Podcast · host Kent C. Dodds

Whilst using remix I realized even after naming a file .client.ts and importing it into the remix page, it does not affect how remix generates html on the server. As an SSR framework it always generates the html on the server and so accessing the window becomes undefined. The solution to that is to run the code in useEffect. I was wondering if there are ways around that instead of having to throw in a bunch of useEffect to solve that. Next.JS has next/dynamic import which can be used and also by setting { ssr: false } , I don't have to worry about window being undefined.ThanksRemix: ways around window undefined

Episode metadata supplied by the publisher feed · Published Sep 13, 2022

Embed this episode

NOW PLAYING

Remix: ways around window undefined

0:00 5:42

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of The Call Kent Podcast?

This episode is 5 minutes long.

When was this The Call Kent Podcast episode published?

This episode was published on September 13, 2022.

Can I download this The Call Kent Podcast episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!