Hello, I assume you are using tokens as it's a stateless app, so you might like to give js-cookie a try, seems to be a better solution than using local storage.
You can use it as follows
import Cookie from "js-cookie"
const token = Cookie.get("token") ? Cookie.get("token") : null;
//to set a cookie
//refer the js-cookie documentation for more options
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.