isServer
True in the server condition build, where effects never run and rendering produces strings.
True in the server condition build, where effects never run and rendering produces strings. Use
it to skip browser-only work. The value is fixed per build: the package export conditions
(node, worker, browser, ...) choose the build, not a runtime check.
Import#
ts
import { isServer } from "@shadow-js/core";
Signature#
ts
const isServer: boolean
Examples#
ts
import { isServer } from "@shadow-js/core";
const width = isServer ? 1024 : window.innerWidth;