App reviews, troubleshooting, and recommendations
So I have a button that when pressed opens a modal window. The script resides in the assets folder and it's ReactJS. We get an error that we cannot use import outside a module so we used babel and compiled the file to bypass ES6. When I swapped out the commonJS file, now I get the error that the modal is not defined.
the modalbutton.liquid file contains {{ 'iwtmodalbutton.js' | asset_url | script_tag: 'module' }} which exports the module.
I have seen a few other articles in here around React and Shopify themes not playing nice in the sandbox. Anyone have any thoughts? Will a compiled file work or can we use ReactJS and maybe another plugin.
My sense is the modal window should be a global for the click handler to work.
I used window reference to export the modal and no dice. window.openOfferModal = openOfferModal;
I am sure there is something I am missing here.
This is the error. I have heard there are issues at times with ReactJS in Shopify theme extensions. Any insights would be helpful.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024