UNPKG

@toolpad/utils

Version:

Shared utilities used by Toolpad packages.

17 lines (16 loc) 354 B
import * as React from 'react'; function subscribe() { return () => {}; } function getSnapshot() { return false; } function getServerSnapshot() { return true; } /** * Returns true when serverside rendering, or when hydrating. */ export default function useSsr() { return React.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }