Skip to main content

assertClientSide()

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

function assertClientSide(): void;

Throws an error if executed not on the client-side (if IS_CLIENT_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.