UNPKG

@suspensive/react

Version:

Suspensive interfaces for react

9 lines (7 loc) 300 B
'use client' import { useSyncExternalStore } from 'react' import { noop } from './utils/noop' const emptySubscribe = () => noop const getSnapshot = () => true const getServerSnapshot = () => false export const useIsClient = () => useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot)