Files
sweet/tests/fixtures_islands/NodeProcess.tsx
T
Tim Reichen 0a634bd2d2 chore: fix lint errors (#2833)
This PR fixes current lint errors thrown by `deno lint`.
2025-03-05 12:31:25 +01:00

22 lines
476 B
TypeScript

import { useEffect } from "preact/hooks";
import { useSignal } from "@preact/signals";
import { IS_BROWSER } from "fresh/runtime";
export function NodeProcess() {
const active = useSignal(false);
useEffect(() => {
active.value = true;
}, []);
// @ts-ignore bundling
// deno-lint-ignore no-process-global
const value = IS_BROWSER ? process.env.NODE_ENV : "no";
return (
<div class={active.value ? "ready" : ""}>
value: {value}
</div>
);
}