Reputation: 13
I was using localStorage in my webApp to store data on client side. But when I've tried to make the app Universal, this causes an issue. How do I solve this issue?
Upvotes: 0
Views: 4500
Reputation: 12420
If you're isomorphically rendering React on the server than the code accessing local storage must be put in componentDidMount as this will not be called on the serverside.
Upvotes: 1