Sanity Library Reference Docs
    Preparing search index...

    Function usePresentationQuery

    • Alpha

      Experimental hook that can run queries in Presentation Tool. Query results are sent back over postMessage whenever the query results change. It also works with optimistic updates in the studio itself, offering low latency updates. It's not as low latency as the useOptimistic hook, but it's a good compromise for some use cases.

      Requires <VisualEditing /> to be rendered on the page to establish the comlink connection.

      Type Parameters

      • const QueryString extends string

      Parameters

      Returns UsePresentationQueryReturns<QueryString>