Hi everyone, I’m running into an issue with a sidebar in my Next.js app. When a user toggles the sidebar, I save the state to localStorage. The problem is that when the page loads, the sidebar “jumps” — it initially renders with the default style and then quickly switches to the style based on the saved localStorage value.
I’d like to apply the last saved state before the page renders to avoid this jump. Does anyone have advice on the best approach to handle this in Next.js?