Open vbrg opened 2 years ago
Thanks a lot, I am very new to React and was struggling with this when I followed the course and wasted so much time trying to figure it out. This worked great
I have an issue where the tasks dont show after starting the app.
I found a better solution.
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
component={About}
to element={<About />}
<Route path='/' exact element={
<>
{showAddTask && <AddTask onAdd={addTask} />}
{tasks.length > 0 ?
<Tasks tasks={tasks}
onDelete={deleteTask}
onToggle={toggleReminder}
/>
: <p>No Tasks available</p>}
</>
} />
Tried doing this tutorial but used React Router v6 instead of v5 and then I got this error
Error: A <Route> is only ever to be used as the child of <Routes> element
So there's some changes and so I madeApp.js
like this insteadand defined a new file
Home.js
like thisProbably stupid. Don't know much about things web-related.