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)