App.tsx 521 Bytes
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import { socket, SocketProvider } from './SocketContext';
import { Login } from './Login';

const App: React.FC = () => {
  return (
    <SocketProvider value={socket}>
      <Router>
        <Switch>
          <Route exact path='/' component={Login}/>
          <Route path='/rooms'></Route>
          <Route path='/:roomId'></Route>
        </Switch>
      </Router>
    </SocketProvider>
  );
}

export default App;