Skip to content

Missing return in map callback and stray semicolon in ProductProvider#3680

Open
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/productprovider-example-bugs
Open

Missing return in map callback and stray semicolon in ProductProvider#3680
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/productprovider-example-bugs

Conversation

@J8118
Copy link
Copy Markdown

@J8118 J8118 commented Apr 10, 2026

Title

Fix missing return in map callback and stray semicolon in ProductProvider example

Description

Summary

Two bugs in the UsingProduct() function of both TypeScript and JavaScript ProductProvider examples:

  1. Missing return in .map() callback — The callback uses a block body { } but has no return before the <button> JSX, so the .map() always produces an array of undefined and no buttons render. Fixed by switching to a concise arrow function body with ( ).

  2. Stray semicolon — A lone ; on line 22 (tsx) / line 21 (jsx) sits between the closing })} of the map and the </> fragment close. This renders as visible text (a literal semicolon character) in the output.

These example files are used to generate documentation on Shopify.dev.

…ider example

The .map() callback used a block body without return, so buttons
never rendered. Also removed a stray semicolon that would render
as visible text. Fixed in both TypeScript and JavaScript examples.
@J8118 J8118 requested a review from a team as a code owner April 10, 2026 07:25
@J8118
Copy link
Copy Markdown
Author

J8118 commented Apr 10, 2026

I have signed the CLA!

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