From 75724ff272ef36b16d7f09de75feda480c0d1612 Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Fri, 29 Dec 2017 20:04:30 +0545 Subject: [PATCH] Create TodoItem component --- src/App.js | 2 +- src/TodoItem.js | 22 ++++++++++++++++++++++ src/TodoList.js | 9 ++------- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/TodoItem.js diff --git a/src/App.js b/src/App.js index a4b18f1..3c83e64 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,5 @@ import React from 'react'; -import TodoList from './TodoList.js'; +import TodoList from './TodoList'; /** * App component. diff --git a/src/TodoItem.js b/src/TodoItem.js new file mode 100644 index 0000000..01729ac --- /dev/null +++ b/src/TodoItem.js @@ -0,0 +1,22 @@ +import React from 'react'; + +/** + * Each todo item. + * + * @param {Object} props + */ +const TodoItem = (props) => { + const { item } = props; + + return ( +
  • +
    + +
    +
  • + ) +} + +export default TodoItem; diff --git a/src/TodoList.js b/src/TodoList.js index b64f450..2c722cd 100644 --- a/src/TodoList.js +++ b/src/TodoList.js @@ -1,4 +1,5 @@ import React from 'react'; +import TodoItem from './TodoItem'; /** * Component to show list of todos. @@ -14,13 +15,7 @@ const TodoList = (props) => {