diff --git a/package.json b/package.json index 7f3c254..02cfbfb 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "bootstrap": "^3.3.7", + "prop-types": "^15.6.0", "react": "^16.2.0", "react-dom": "^16.2.0", "react-scripts": "1.0.17" diff --git a/src/components/TodoCount.js b/src/components/TodoCount.js index 31b68dd..5b81d29 100644 --- a/src/components/TodoCount.js +++ b/src/components/TodoCount.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; /** * Component to display number of todos. @@ -18,4 +19,8 @@ const TodoCount = (props) => { ); } +TodoCount.propTypes = { + count: PropTypes.number +} + export default TodoCount; diff --git a/src/components/TodoItem.js b/src/components/TodoItem.js index 01729ac..ab4f052 100644 --- a/src/components/TodoItem.js +++ b/src/components/TodoItem.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; /** * Each todo item. @@ -19,4 +20,8 @@ const TodoItem = (props) => { ) } +TodoItem.propTypes = { + item: PropTypes.object +} + export default TodoItem; diff --git a/src/components/TodoList.js b/src/components/TodoList.js index cfd8c6b..71bbc86 100644 --- a/src/components/TodoList.js +++ b/src/components/TodoList.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import InputBox from './InputBox'; import TodoItem from './TodoItem'; @@ -29,4 +30,8 @@ const TodoList = (props) => { ) } +TodoList.propTypes = { + items: PropTypes.array +} + export default TodoList;