Using localStorage after creating a project with solidstart
I've just created a project with solidstart and started to add an option for dark mode using localStorage, but get
as a result... I understand that when using SSR I won't have access to localStorage but I don't need SSR.
How do I configure this properly? Can I simply delete entry-server?
4 Replies
You can turn of SSR with
which resolves my issue
Or you use cookieStorage/makePersisted from @solid-primitives/storage so you can even render the dark mode on the server and avoid the flash of missing mode.
thanks thats very useful
Use cookies with SSR