import React, { useState } from 'react'; import 'rsuite/lib/styles/index.less'; import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; import { AuthContext } from './helpers/authContext'; import { PrivateRoute } from './components'; import { Home, Login, Register, Dashboard, Invite, Availability, Schedule, } from './screens'; const existingToken = localStorage.getItem('token'); // const existingUser = JSON.parse(localStorage.getItem('user')); export default function App() { const [authToken, setAuthToken] = useState(existingToken || ''); const setToken = (data) => { localStorage.setItem('token', JSON.stringify(data)); setAuthToken(data); }; return ( ); }