Skip to content

Fix merchandise {is: string} typo to {id: string} in useOptimisticCart#3687

Open
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/useoptimisticcart-type-typo
Open

Fix merchandise {is: string} typo to {id: string} in useOptimisticCart#3687
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/useoptimisticcart-type-typo

Conversation

@J8118
Copy link
Copy Markdown

@J8118 J8118 commented Apr 10, 2026

Title

Fix merchandise: {is: string} typo to {id: string} in useOptimisticCart

Description

Summary

The default generic type parameter for useOptimisticCart has merchandise: {is: string} on line 50, which should be merchandise: {id: string}. This is a single-character typo (is vs id) in the TypeScript generic default.

This affects consumers who rely on the default type parameter (i.e., don't pass an explicit type argument to useOptimisticCart). TypeScript won't correctly type-check merchandise.id accesses when using the default generic.

File changed:

  • packages/hydrogen/src/cart/optimistic/useOptimisticCart.tsx (line 50)

Before:

export function useOptimisticCart<
  DefaultCart = {
    lines?: {
      nodes: Array<{id: string; quantity: number; merchandise: {is: string}}>;
    };
  },
>

After:

export function useOptimisticCart<
  DefaultCart = {
    lines?: {
      nodes: Array<{id: string; quantity: number; merchandise: {id: string}}>;
    };
  },
>

The default generic type parameter had a single-character typo:
merchandise: {is: string} instead of merchandise: {id: string}.
@J8118 J8118 requested a review from a team as a code owner April 10, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant