Boopie
_layouts are static / Server Side? How "any state set by middleware is available via props.state"
Hi all. I am trying to make a dynamic layout that changes based on the client window width (window.innerWidth) so i can swap the layout when the screen is resized or is too small. I wasn't able to use a layout because it seems like layouts are server side and don't count as Islands so:
- I cant
useEffect
- using a Singal
doesnt update _layout and re-render on signal updates it just gets the signal once on load...
Instead I have wrapped my whole app in an Island: https://github.com/ali-layken/BurstUI/blob/main/islands/DynamicLayout.tsx
And this feels wrong...
I read the other posts about layout and I read all I could find online but I am not sure how dynamic resizing plays into the Island Architecture...
I can feel the badness although i am not sure ,like i feel like when the site swaps from desktop to mobile/narrow it is re-rendering "static" content but i am not sure I feel like ive made a mess of the Fresh Architecture.
https://burst.deno.dev <- you can see the cube animation restart when the dynamic layout swaps which makes sense because its an island i don't mind the visual glitch really what i am more worried about is not using Fresh correctly and that slowing down my page loads.6 replies