Make Client Only component with SSR
Is there a way to make a component client only. In this example the use of localStorage throws an error during SSR.
1 Reply
fair-rose•13mo ago
You'll need to provide an alternative render path for SSR
So you'll either need an isomorphic localStorage wrapper, or just check
if (document !== 'undefined') { use localStorage }