Use React in app block theme extension

Topic summary

Developers are exploring how to use React within Shopify theme app extensions, which traditionally rely on Liquid templates and vanilla JavaScript. The core challenge is that app blocks don’t natively support React frameworks.

Established Solution:

  • Bundle React apps into a single JavaScript file using tools like Webpack or Vite
  • Reference the bundled file (e.g., bundle.js) in the app-block’s Liquid schema under the javascript property
  • Create React source code in a separate folder outside the extension directory
  • Configure the build tool to output the compiled bundle into the extension’s /assets folder

Common Implementation Issues:

  • React requires a DOM element to mount to, which must be defined in the .liquid file
  • Asset management (images, CSS) becomes complicated when transitioning from Liquid to React
  • Developers struggle with proper folder structure and build configuration
  • Size limits and Shopify’s restrictions on extension folder contents create constraints

Resources & Alternatives:

  • A community member shared a template repository demonstrating React + Tailwind CSS setup
  • Settings can be passed from Liquid schema to React via data attributes on the root div
  • At least one developer abandoned this approach entirely, opting to embed their React app as an externally-hosted iframe

Status: The discussion remains open with ongoing questions about asset handling and build configuration. Multiple participants note that Shopify’s documentation lacks comprehensive guidance on React integration.

Summarized with AI on October 25. AI used: claude-sonnet-4-5-20250929.

Looks good to me. Only thing I see is here:

data-theme-color="{{ settings.color_id }}"

Should look something like this in my experience:

data-theme-color="{{ block.settings.color_id }}"

Anytime you reference an App Block setting you just need block in front of it.

As to your second question, we’ve had success having our React App living in a separate folder outside of the extensions folder (Shopify is very picky on its structure) and creating an npm command to compile and push the bundled app to the appropriate locations inside of the extensions folder.

Then just continue to add other Liquid blocks as you see fit and need. Just be aware that for App Extensions, Shopify has a limit of 10MB for Liquid files across the whole extensions folder.

1 Like