Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

The useEffect does not be triggered or window object is not defined

The useEffect does not be triggered or window object is not defined

PhuocNguyen
Shopify Partner
2 0 1
Hi,

I was trying to use the useEffect hook to add an event listener in my app._index.tsx file, but I couldn't figure out why the side effect wasn't being triggered when the app started. I suspect it's due to Server Side Rendering (SSR), which would prevent hooks or the window object from being used.

I've set it up based on the Shopify-app-template-remix.

Thank you for your assistance.

Replies 0 (0)