The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
Hi,
I was wondering how to get window.innerWidth or window.innerheigth to get viewport sizes since I get errors if I call window.innerWidth inside a component.
the errors:
Uncaught TypeError: window.innerHeight is not a function Uncaught TypeError: window.innerWidth is not a function
EpicWebs2
What are you trying to achieve? Because you can use 100vh and 100vw in CSS. Which will allow you to size components to the browser viewport.
1 Like
mburridge3
Hi @jacopo.bombardieri
Frontity needs to run on both server-side and client-side. The window object doesn’t exist server-side, so you may need to wrap your code that gets the viewport size in one of the actions that only run on the client, such as afterCSR.