I'm facing a bug where, when the sidebar is collapsed and I refresh the page, it initially renders with the default open state from my useState. This results in an error, giving the appearance of the sidebar opening and closing unintentionally.
pls help!
this es mi code: (https://i.stack.imgur.com/b1mgo.png)
I want the sidebar to render with the localStorage value instead of the useState default when collapsed and the user returns. Currently, the synchronous nature of useState results in rendering the default value before the asynchronous localStorage call