Skip to content

Use of Shopify Hydrogen components with "island architecture"? #1586

Answered by frandiox
kevin-mitchell asked this question in Help
Discussion options

You must be logged in to vote

I'm not aware of any existing example but here are some guidelines that should work:

First, try running React itself without a build step: https://github.com/sonyarianto/react-without-buildsteps/blob/main/index.html

That uses @babel/standalone to process JSX at runtime. If you don't want that (the package is heavy), you can try using React without JSX, although the syntax gets a bit harder: https://react.dev/reference/react/createElement#creating-an-element-without-jsx
There's an interesting approach here to make this syntax a bit better: https://dev.to/dperrymorrow/using-react-without-jsx-no-build-14gg

Once you get that working, try adding hydrogen-react with <script crossorigin src="htt…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@frandiox
Comment options

Answer selected by kevin-mitchell
@kevin-mitchell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants