Skip to content

Commit 6ff6124

Browse files
committed
Remove unnecessary mention of isMounted from scheduling useEffect hook.
1 parent e5dc061 commit 6ff6124

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/plugins/es_ui_shared/public/request/use_request.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ export const useRequest = <D = any, E = Error>(
134134

135135
// Schedule the next poll request when the previous one completes.
136136
useEffect(() => {
137-
if (isMounted.current === false) {
138-
// Don't schedule a request on component mount.
139-
return;
140-
}
141-
142137
// When a request completes, attempt to schedule the next one. Note that we aren't re-scheduling
143138
// a request whenever sendRequest's dependencies change.
144139
if (!isLoading) {

0 commit comments

Comments
 (0)