Faced some issues with " component={ShowTodoList} " as well as not enclosing with <Routes> </Routes> Had to make the changes mentioned for this to work.
<Routes> </Routes>
// src/App.js import { BrowserRouter, Route, Routes } from "react-router-dom"; //changed import { ShowTodoList } from "./components/showTodoList"; import { CreateTodo } from "./components/createTodo"; import "./App.scss"; function App() { return ( <div className="app-contents"> <BrowserRouter> /*---------------------------Changes-------------------------*/ <Routes> <Route exact path="/" element={<ShowTodoList/>} /> <Route path="/create-todo" element={<CreateTodo/>} /> </Routes> /*---------------------------Changes-------------------------*/ </BrowserRouter> </div> ); } export default App;
Thanks for the great tutorial by the way❤.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Faced some issues with " component={ShowTodoList} " as well as not enclosing with
<Routes> </Routes>
Had to make the changes mentioned for this to work.
Thanks for the great tutorial by the way❤.