Server Components and Functions
cacheSignal
Provides cancellation tied to the active server render. Pass the signal to an operation that supports cancellation; obtaining a signal alone does not stop work. Outside the render context it can be null.
Formal Syntax & Structure
react syntaxreact
cacheSignal()Return Value
AbortSignal | null
Signal aborted when the server render ends, or null without an applicable render.
Working Example
Example Snippetreact
import { cacheSignal } from 'react';export default function Page() { const signal = cacheSignal(); return <p>{signal ? 'Render-scoped signal' : 'No signal'}</p>;}