Skip to content

Commit fc288f9

Browse files
authored
Update UserPage.js
Hi there, here the effect was running continuously and the request was sent without a break. I think we need to run it only once.
1 parent c79f477 commit fc288f9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

order-ui/src/components/user/UserPage.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ function UserPage() {
1717

1818
useEffect(() => {
1919
async function fetchData() {
20-
setIsLoading(true)
20+
setIsLoading(true);
2121

2222
try {
23-
const response = await orderApi.getUserMe(user)
24-
setUserMe(response.data)
23+
const response = await orderApi.getUserMe(user);
24+
setUserMe(response.data);
2525
} catch (error) {
26-
handleLogError(error)
26+
handleLogError(error);
2727
} finally {
28-
setIsLoading(false)
28+
setIsLoading(false);
2929
}
3030
}
3131

32-
fetchData()
33-
}, [user])
32+
fetchData();
33+
}, []);
3434

3535
const handleInputChange = (e, { name, value }) => {
3636
if (name === 'orderDescription') {
@@ -84,4 +84,4 @@ function UserPage() {
8484
)
8585
}
8686

87-
export default UserPage
87+
export default UserPage

0 commit comments

Comments
 (0)