'use client' import { useSyncExternalStore } from 'react' const reactServerRequestsServerSnapshot: never[] = [] const ServerRequestsStore = { subscribe: typeof window === 'undefined' ? () => () => {} : window.reactServerRequests.subscribe, getSnapshot: typeof window === 'undefined' ? () => [] : window.reactServerRequests.getStoreSnapshot, getServerSnapshot: () => reactServerRequestsServerSnapshot, } export function ReactServerRequests() { const reactServerRequests = useSyncExternalStore( ServerRequestsStore.subscribe, ServerRequestsStore.getSnapshot, ServerRequestsStore.getServerSnapshot ) return ( <>
{reactServerRequests.length} Server Request entries
{JSON.stringify(request.properties, null, 2)}