Skip to content

Server vs Client distinction #9940

@aadamsx

Description

@aadamsx

How can we tell if we are on the server or in the browser? In the Node world, we mostly just use the lack of a window object. But of course Deno has this object. What's a great, fool-proof way to tell in Deno?

I'm asking because I'm using Deno + SSR and would like to avoid the React useLayoutEffect warning like I'm getting when using Zustand: pmndrs/zustand#347 in Aleph: alephjs/aleph.js#221

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions