#localstorage is not defined error in nextjshow
7 messages · Page 1 of 1 (latest)
@median compass so what can be done i need localstorage to access the token
Don’t use getServerSideProps in that case. In react, make an useEffect to get the localStorage value as a state then fetch it with the state
Or use cookies which is available in getServerSideProps
@median compass if i use the useEffect hook will it effect in the SEO ?
Basically if you use localStorage you are forced to use client side fetching