My client has a Stripe script for the pricing tables, which I use in the Prismic Embed field.
Problem:
The pricing tables don't show up for the first time the page loads. I had to refresh the page to load the pricing tables. However, this issue occurs for the Stripe script and HopSpot form as well.
But for now, I need help to figure out a Stripe script loading issue in the Prismic Embed field.
Next.js code
import Bounded from "@/components/Bounded/Bounded";
import InnerWrapper from "@/components/InnerWrapper/InnerWrapper";
import { Content, asText } from "@prismicio/client";
import { SliceComponentProps } from "@prismicio/react";
/**
* Props for `Embed`.
*/
export type EmbedProps = SliceComponentProps<Content.EmbedSlice>;
/**
* Component for "Embed" Slices.
*/
const Embed = ({ slice }: EmbedProps): JSX.Element => {
return (
<Bounded
data-slice-type={slice.slice_type}
data-slice-variation={slice.variation}
>
<InnerWrapper className="w-full mx-auto px-5 md:pt-[100px]">
<div
dangerouslySetInnerHTML={{ __html: asText(slice.primary.embed) }}
/>
</InnerWrapper>
</Bounded>
);
};
export default Embed;
Thank you for your help!