score:1

import {createContext} from 'react';

const token = localStorage.token;

const authContext = createContext({
  isAuthenticated: token !== null && token !== 'undefined' && token !== '',
  loading: false,
});

export default authContext;

Related Query

More Query from same tag