Can't get window.innerWidth in Shopify Post-Purchase Extension

Can't get window.innerWidth in Shopify Post-Purchase Extension

noahfaro
Shopify Partner
11 0 5

Hi! The post-purchase extension has an extremely limited set of props that we can pass to the allowed components, and so I am try to make the application more responsive by either using CSS or having a resize callback using window.addEventListener and window.innerWidth.

 

When I try using CSS, it is correctly importing into the index.tsx file, but no CSS changes are added to the components. And, more weird, when I try to access the window object I get "window is not defined". If anyone can explain either of these situations that would be super helpful, thank you in advance for your help!

Replies 0 (0)