import { SuspenseWatch } from "@milliman/datadog-ux-utils/react/SuspenseWatch";
export function ResultsSection() {
return (
<SuspenseWatch
id="ResultsSection"
fallback={<Spinner label="Loading results…" />}
options={{
timeoutMs: 1500,
sampleRate: 25,
onSlow: ({ id, timeoutMs }) => {
console.warn(`${id} still loading after ${timeoutMs}ms`);
},
}}
>
<ResultsList />
</SuspenseWatch>
);
}
SuspenseWatch
Wraps a React.Suspense boundary and reports when the fallback remains visible longer than
timeoutMs
. A "slow" event is emitted once per suspend cycle (even if the fallback remains longer), and an optional "resolved" event is emitted when the content finally appears.Implementation details:
addAction
(and optionallyaddError
) and is sampled.