Issue
here is my app.js
<Router>
<Header title="My Todos List" />
<Routes>
<Route path="/about" element={<About />} />
<Route path="/" render={() => {
return (
<>
<AddTodo addTodo={addTodo} />
<Todos todos={todos} onDelete={onDelete} />
</>)
}} />
</Routes>
<Footer />
</Router>
the render function is not rendering anything in my home page
Solution
You can use element like this
<Route path="/" elemen={
<>
<AddTodo addTodo={addTodo} />
<Todos todos={todos} onDelete={onDelete} />
</>
}
/>
Answered By - Anis Shreyan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.