App.jsx 356 B

1234567891011
  1. import { LoginForm } from './components/loginForm/LoginForm';
  2. import { ChatPage } from './components/chatPage/ChatPage';
  3. import { useSelector } from 'react-redux';
  4. export default function App() {
  5. const token = useSelector(state => localStorage.getItem('token') || state.userDataReducer.token);
  6. return token ? <ChatPage /> : <LoginForm/>
  7. };