text: import { useEffect } from "react";
  import { useDispatch } from "react-redux";
  import { Switch, Route } from "react-router-dom";
  import AppBar from "./components/AppBar";
  import TodosView from "./views/TodosView";
  import HomeView from "./views/HomeView";
  import RegisterView from "./views/RegisterView";
  import LoginView from "./views/LoginView";
  import Container from "./components/Container";
  import { authOperations } from "./redux/auth";
  
  export default function App() {
    const dispatch = useDispatch();
  
    useEffect(() => {
      dispatch(authOperations.fetchCurrentUser());
    }, [dispatch]);
  
    return (
      <Container>
        <AppBar />
  
        <Switch>
          <Route exact path="/" component={HomeView} />
          <Route path="/register" component={RegisterView} />
          <Route path="/login" component={LoginView} />
          <Route path="/todos" component={TodosView} />
        </Switch>
      </Container>
    );
  }
  