How are you implementing the new Snipcart installation method in Next.js?

One possible approach is to run the script in a useEffect call (with an empty dependency array) in the _app.tsx page. This creates some issues in development if React Strict Mode is on because useEffect fires twice, but it seems okay with React Strict Mode turned off.

@duketide You can try putting the script directly in the component like in this example.

1 Like

Thanks, @jpsirois! I ended up going this route, although I omitted the link tags shown in lines 7, 8, and 9 of the example.

1 Like