Skip to main content

assertServerSide()

import { assertServerSide } from '@dr.pogodin/react-utils';

function assertServerSide(): void;

Throws an error if executed not on the client-side (if IS_SERVER_SIDE equals false).

Beware

It relies on Babel and Webpack configurations provided by react-utils library being used by the host code, along with provided mechanics for server creation and client-side app initialization. It won't work correctly with a different app setup.