Skip to content

Commit 8154794

Browse files
committed
Create TodoItem component
1 parent cf961b5 commit 8154794

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

react-todos/src/App.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "./App.css";
2+
import TodoRowItem from "./components/TodoRowItem";
23

34
function App() {
45
return (
@@ -15,17 +16,8 @@ function App() {
1516
</tr>
1617
</thead>
1718
<tbody>
18-
<tr>
19-
<th scope="row">1</th>
20-
<td>Feed dog</td>
21-
<td>Eric</td>
22-
</tr>
23-
24-
<tr>
25-
<th scope="row">2</th>
26-
<td>Get haircut</td>
27-
<td>Eric</td>
28-
</tr>
19+
<TodoRowItem number={1} task={"Feed dog"} assignee={"Eric"} />
20+
<TodoRowItem number={2} task={"Get haircut"} assignee={"Eric"} />
2921
</tbody>
3022
</table>
3123
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function TodoRowItem(props) {
2+
return (
3+
<tr>
4+
<th scope='row'>{props.number}</th>
5+
<td>{props.task}</td>
6+
<td>{props.assignee}</td>
7+
</tr>
8+
)
9+
}

0 commit comments

Comments
 (0)