Skip to content

mediaIndexForVariant

const mediaIndexForVariant: (media, variant) => number | null

Defined in: .pnpm/@[email protected]_graphql@[email protected]_typescript@6.0.3/node_modules/@storesynk/core/dist/product/render-state.d.ts:72

The media index showing the variant’s own image, or null when the variant has none / it isn’t in the media list. Shared by the initial URL-selected render (server AND client) and the client’s option-change handler, so the gallery can never disagree between the two halves. Generic: the element’s narrower Variant/MediaItem shapes share it.

ReadonlyArray<{ __typename?: string; image?: { url: string; } | null; }>

{ image?: { url: string; } | null; } | null

number | null