File tree 3 files changed +11
-2
lines changed 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 7
7
"@testing-library/react" : " ^9.3.2" ,
8
8
"@testing-library/user-event" : " ^7.1.2" ,
9
9
"classnames" : " ^2.2.6" ,
10
+ "prop-types" : " ^15.7.2" ,
10
11
"react" : " ^16.12.0" ,
11
12
"react-dom" : " ^16.12.0" ,
12
13
"react-scripts" : " 3.3.0"
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class App extends Component {
13
13
{ title : "Đi shopping" , isComplete : true } ,
14
14
{ title : "Đi siêu thị" , isComplete : false } ,
15
15
{ title : "Nấu Cơm" , isComplete : false } ,
16
- { title : "Rửa Bát" , isComplete : true }
16
+ { title : "Rửa Bát" , isComplete : false }
17
17
]
18
18
} ;
19
19
this . onKeyUp = this . onKeyUp . bind ( this ) ;
Original file line number Diff line number Diff line change 1
1
import React , { Component } from "react" ;
2
+ import PropTypes , { shape , bool } from "prop-types" ;
2
3
import "./ItemTodo.css" ;
3
4
import classNames from "classnames" ;
4
5
import imgCheck from "../img/check.svg" ;
5
6
import imgCheckDone from "../img/success.svg" ;
6
- class ItemTodo extends Component {
7
+ class ItemTodo extends React . Component {
7
8
render ( ) {
8
9
const { item, onClick } = this . props ;
9
10
let url = imgCheck ;
@@ -22,4 +23,11 @@ class ItemTodo extends Component {
22
23
) ;
23
24
}
24
25
}
26
+ ItemTodo . propTypes = {
27
+ item : PropTypes . shape ( {
28
+ isComplete : PropTypes . bool . isRequired ,
29
+ title : PropTypes . string . isRequired
30
+ } ) ,
31
+ onClick : PropTypes . func . isRequired
32
+ } ;
25
33
export default ItemTodo ;
You can’t perform that action at this time.
0 commit comments