0

Webpack compiled successfully, yet the page is blank.

import React from "react";
import { BrowserRouter as Routes, Route } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";



import Navbar from "./components/Navbar";
import ExercisesList from "./components/ExercisesList";
import EditExercise from "./components/EditExercise";
import CreateExercise from "./components/CreateExercise";
import CreateUser from "./components/CreateUser";

function App() {
  return (
      <Routes>
        <div className="container">
          <Navbar />
          <br />
          <Route path="/" exact component={ExercisesList} />
          <Route path="edit/:id" component={EditExercise} />
          <Route path="create" component={CreateExercise} />
          <Route path="/user" component={CreateUser} />
        </div>
      </Routes>
  );
}

export default App;

The message in the console saying that Route cannot be rendered directly, so I wrapped it in the Routes but the page remains blank. What am I missing here?

Drew Reese
  • 165,259
  • 14
  • 153
  • 181
Vlad
  • 1
  • 1
  • https://stackoverflow.com/questions/69832748/error-error-a-route-is-only-ever-to-be-used-as-the-child-of-routes-element – JASBIR SINGH Oct 28 '22 at 07:18

0 Answers0