Skip to content

Commit 6210536

Browse files
committed
third
1 parent 4ce6fc7 commit 6210536

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lang/js/react/third/src/App.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,30 @@ class App extends React.Component<Props, State> {
3333
};
3434

3535
render() {
36+
const { searchTerm, list } = this.state;
37+
3638
return (
3739
<div className="App">
3840
<header className="App-header">
3941
<form>
40-
<input type="text" onChange={this.onSearchChange} />
42+
<input type="text" value={searchTerm} onChange={this.onSearchChange} />
4143
</form>
42-
<div>
43-
{ this.state.list.filter(this.isSearched(this.state.searchTerm)) }
44-
</div>
4544
<p>
4645
Check out "hello" + "4" = { concat("hello", "3") }.
4746
</p>
4847
<p>
4948
{ `Here's an interpolated string of concat("hello", "3") = ${ concat("hello", "3") }. Amazing?` }
5049
</p>
5150

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+
)
6060
}
6161
</header>
6262
</div>

0 commit comments

Comments
 (0)