File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -33,30 +33,30 @@ class App extends React.Component<Props, State> {
33
33
} ;
34
34
35
35
render ( ) {
36
+ const { searchTerm, list } = this . state ;
37
+
36
38
return (
37
39
< div className = "App" >
38
40
< header className = "App-header" >
39
41
< form >
40
- < input type = "text" onChange = { this . onSearchChange } />
42
+ < input type = "text" value = { searchTerm } onChange = { this . onSearchChange } />
41
43
</ form >
42
- < div >
43
- { this . state . list . filter ( this . isSearched ( this . state . searchTerm ) ) }
44
- </ div >
45
44
< p >
46
45
Check out "hello" + "4" = { concat ( "hello" , "3" ) } .
47
46
</ p >
48
47
< p >
49
48
{ `Here's an interpolated string of concat("hello", "3") = ${ concat ( "hello" , "3" ) } . Amazing?` }
50
49
</ p >
51
50
52
- { this . state . list . map ( ( item : string ) =>
53
- < div key = { `id-${ item } ` } >
54
- < p > { item } </ p >
55
- < button onClick = { ( ) => this . onClick ( `id-${ item } ` ) } type = "button" >
56
- Dismiss
57
- </ button >
58
- </ div >
59
- )
51
+ { list . filter ( this . isSearched ( searchTerm ) )
52
+ . map ( ( item : string ) =>
53
+ < div key = { `id-${ item } ` } >
54
+ < p > { item } </ p >
55
+ < button onClick = { ( ) => this . onClick ( `id-${ item } ` ) } type = "button" >
56
+ Dismiss
57
+ </ button >
58
+ </ div >
59
+ )
60
60
}
61
61
</ header >
62
62
</ div >
You can’t perform that action at this time.
0 commit comments