
ctrl+k
Enter a search term above to see results...
Enter a search term above to see results...
The SSR utilities provide constants for detecting whether the code is running on the server or client side.
const isServer
A boolean constant indicating whether the current environment is server-side.
import { isServer } from '@semantic-ui/utils';
if (isServer) { console.log("This code is running on the server");} else { console.log("This code is running in the browser");}
const isClient
A boolean constant indicating whether the current environment is client-side (browser).
import { isClient } from '@semantic-ui/utils';
if (isClient) { document.addEventListener('DOMContentLoaded', () => { console.log("DOM is fully loaded and parsed"); });}