Just started leaning Reac. Trying to build a simple App, which shows the list of Tasks. However when I run the App, it does not show anyout in the browser. There is no error in the console or anything. Not sure what is missing here.
Here is the code:
- App.js
import React from 'react';
import TaskList from './TaskList';
function App() {
const tasks = [
{id:0,description:"1st Task",isDone:false},
{id:1,description:"2st Task",isDone:false}
]
return (
<div>
<TaskList tasks={tasks} />
</div>
);
}
export default App;
- TaskList.js
import React from "react";
import Task from "./Task";
export default({ tasks }) => {
return (
<ul className="list-group">
{
tasks.map(task => {
<li key={task.id} className="List-group-item">
<Task task={task} />
</li>
})}
</ul>
)
}
- Task.js
import React from "react";
export default ({task}) => {
return(
<p>
{task.description}
</p>
)
}
The list of tasks are not shown in the screen, neither there is any error in console.