'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

    {reactServerRequests.map((request, index) => (
  1. {request.type}: {request.name || ''} ({Math.round(request.startTime)}ms– {Math.round(request.endTime)}ms)
    {JSON.stringify(request.properties, null, 2)}
  2. ))}
) }