Hello,
The website I am working on uses Bokun for online booking / gift card purchases.
They supply a booking widget that is essentially a script tag that dynamically loads the booking / gift card buying interface. Nothing ground breaking there.
The embedded code is set within page content and rendered as below...
<div dangerouslySetInnerHTML={{ __html: page.body }} className="" />
However I'm using Shopify Hydrogen (react / remix) (above code) to render the below code (page content).
<script type="text/javascript" src="https://widgets.bokun.io/assets/javascripts/apps/build/BokunWidgetsLoader.js?bookingChannelUUID=XXXXX" async></script>
<div class="bokunWidget" data-src="https://widgets.bokun.io/online-sales/XXXX/gift-card/XXXX"></div>
I believe I have sorted out the Security Policy errors e.g. *.bokun.io and *.polyfill.io
But now I'm now presented with (hopefully) one last error I can't seem to fix...
Warning: Prop `type` did not match. Server: "text/javascript" Client: "application/ld+json"
Any ideas / suggestions?
Thanks.
Okay I solved this with the help of other posts on SO...
Remember that your page content will still need to include the following code...
In my example, I created a custom route called /book/my-event-1, which serves a standard Shopify page only if there exists the bokun tag. That way I have two ways to load a Shopify Hydrogen page i.e. /pages/my-standard-page, /book/my-event-1. If the bokun meta is there for a standard page it will 404 so there is no duplication. There may be an issue to resolve with SEO later down the line so perhaps use this approach with caution.