Skip to content

Commit 22e8ed3

Browse files
Miguel Angel Chimali CobanoMiguel Angel Chimali Cobano
authored andcommitted
reformat
1 parent c069296 commit 22e8ed3

File tree

1 file changed

+4
-4
lines changed
  • 04-frameworks/01-react/03-react-hooks/07-custom-hook

1 file changed

+4
-4
lines changed

04-frameworks/01-react/03-react-hooks/07-custom-hook/Readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Summary
44

5-
This example takes as its starting point the \ \_06-ajax-field-change example.
5+
This example takes as its starting point the _06-ajax-field-change_ example.
66

77
Hooks are cool, but our functional component seems to get cluttered, is
88
there a way to extract functionality outside the functional component?
@@ -31,13 +31,13 @@ export const MyComponent = () => {
3131
// Load full list when the component gets mounted and filter gets updated
3232
React.useEffect(() => {
3333
fetch(`https://jsonplaceholder.typicode.com/users?name_like=${filter}`)
34-
.then((response) => response.json())
35-
.then((json) => setUserCollection(json));
34+
.then(response => response.json())
35+
.then(json => setUserCollection(json));
3636
}, [filter]);
3737

3838
return (
3939
<div>
40-
<input value={filter} onChange={(e) => setFilter(e.target.value)} />
40+
<input value={filter} onChange={e => setFilter(e.target.value)} />
4141
<ul>
4242
{userCollection.map((user, index) => (
4343
<li key={index}>{user.name}</li>

0 commit comments

Comments
 (0)