Sanity Library Reference Docs
    Preparing search index...

    Interface ProviderPropsBeta

    Props for a studio.components.provider component: a middleware for the providers a plugin needs across the whole studio. StudioProvider renders it under the studio's own providers and above StudioLayout, so a promise created here (for example with react-rx's useObservablePromise) and passed down through a context can be use()d below without a boundary of its own: a layout or navbar suspends up to the studio's loading screen, and a tool or its activeToolLayout up to the tool's own loading boundary. Keep it small and synchronous, not lazy().

    interface ProviderProps {
        children: ReactNode;
        renderDefault: (props: ProviderProps) => Element;
    }
    Index

    Properties

    children: ReactNode

    The rest of the studio. Render it through renderDefault(props), which also lets the other providers in the chain wrap it; rendering it directly skips them.

    renderDefault: (props: ProviderProps) => Element