Sanity Library Reference Docs
    Preparing search index...

    Type Alias InferStrictComponents<T>

    InferStrictComponents: Omit<
        PortableTextComponents<PortableTextValueItem<T>>,
        "types" | "marks" | "block" | "list" | "listItem",
    > & StrictPortableTextTypeComponentOverrides<PortableTextValueItem<T>> & StrictPortableTextMarkComponentOverrides<
        PortableTextValueItem<T>,
    > & StrictPortableTextBlockComponentOverrides<PortableTextValueItem<T>> & StrictPortableTextListComponentOverrides<
        PortableTextValueItem<T>,
    > & StrictPortableTextListItemComponentOverrides<PortableTextValueItem<T>>

    Infer Portable Text components from a value type, requiring handlers for all custom object types and disallowing extra custom object type handlers.

    This is used the same way as InferComponents, but serves a different purpose: InferComponents is forgiving and mirrors the inline <PortableText components={...} /> experience, allowing custom handlers to be omitted and allowing handlers for types that do not exist in, or could not be inferred from, the value type. InferStrictComponents is strict: it requires inferred custom handlers and rejects unknown ones.

    Type Parameters

    • T