Sanity Library Reference Docs
    Preparing search index...
    useTopic: <K extends StateTopic>(topic: K) => TopicData<K> = ...

    Returns the current value of a dashboard state topic and follows later updates.

    The hook suspends until the topic publishes its first value, using the message bus query deadline. A topic declared with TopicResult resolves to its successful value; a failed result throws a TopicError to the nearest error boundary.

    Type declaration

    function ForegroundApplication() {
    const foregroundId = useTopic('applications.foreground')
    return <span>{foregroundId ?? 'No application in the foreground'}</span>
    }