Sanity Library Reference Docs
    Preparing search index...

    Type Alias TranslateComponentMap<TComponentProps>

    TranslateComponentMap: Record<
        string,
        | ComponentType<{ children?: ReactNode } & TComponentProps>
        | keyof React.JSX.IntrinsicElements,
    >

    A map of component names to React components. The component names are the names used within the locale resources, eg a key of SearchTerm should be rendered as <SearchTerm/> or <SearchTerm>{{term}}</SearchTerm> (no whitespace in tag, nor attributes).

    Each component receives children, as well as any props provided through the componentProps prop of <Translate>. Note that componentProps are forwarded to every component in this map (including exotic ones like memo or forwardRef components) - intrinsic HTML tags (eg {strong: 'strong'}) never receive them.

    Type Parameters

    • TComponentProps extends object = object