diff --git a/npm/react/cypress/component/advanced/hooks/counter2-with-hooks.jsx b/npm/react/cypress/component/advanced/hooks/counter2-with-hooks.jsx
index 8d12775ee3c6..12fee25c14a3 100644
--- a/npm/react/cypress/component/advanced/hooks/counter2-with-hooks.jsx
+++ b/npm/react/cypress/component/advanced/hooks/counter2-with-hooks.jsx
@@ -6,7 +6,7 @@ export default function Counter2WithHooks () {
useEffect(() => {
document.title = `You clicked ${count} times`
- })
+ }, [count])
return (
diff --git a/npm/react/cypress/component/advanced/mocking-axios/1-users.jsx b/npm/react/cypress/component/advanced/mocking-axios/1-users.jsx
index 0e896fa1d0ed..4286947f6674 100644
--- a/npm/react/cypress/component/advanced/mocking-axios/1-users.jsx
+++ b/npm/react/cypress/component/advanced/mocking-axios/1-users.jsx
@@ -8,7 +8,6 @@ export function Users () {
const getUsers = async () => {
const response = await axios.get('https://jsonplaceholder.cypress.io/users?_limit=3')
- // JSON responses are automatically parsed.
setUsers(response.data)
}
diff --git a/npm/react/cypress/component/advanced/mocking-axios/2-users-api.jsx b/npm/react/cypress/component/advanced/mocking-axios/2-users-api.jsx
index 96fcbc13c075..f8d2274fdf7b 100644
--- a/npm/react/cypress/component/advanced/mocking-axios/2-users-api.jsx
+++ b/npm/react/cypress/component/advanced/mocking-axios/2-users-api.jsx
@@ -8,7 +8,6 @@ export function Users () {
const getUsers = async () => {
console.log({ axiosApi })
const response = await axiosApi.get('https://jsonplaceholder.cypress.io/users?_limit=3')
- // JSON responses are automatically parsed.
setUsers(response.data)
}
diff --git a/npm/react/cypress/component/advanced/renderless/mouse-movement.jsx b/npm/react/cypress/component/advanced/renderless/mouse-movement.jsx
index 609337969ec5..7782e8f44d69 100644
--- a/npm/react/cypress/component/advanced/renderless/mouse-movement.jsx
+++ b/npm/react/cypress/component/advanced/renderless/mouse-movement.jsx
@@ -36,7 +36,7 @@ export default function MouseMovement ({ onMoved }) {
clearTimeout(timer)
setTimer(undefined)
}
- })
+ }, [])
return null
}
diff --git a/npm/react/cypress/component/advanced/set-timeout-example/App.jsx b/npm/react/cypress/component/advanced/set-timeout-example/App.jsx
index 6346e91ba177..c0cd7c76af93 100644
--- a/npm/react/cypress/component/advanced/set-timeout-example/App.jsx
+++ b/npm/react/cypress/component/advanced/set-timeout-example/App.jsx
@@ -12,7 +12,7 @@ function App () {
return () => {
clearTimeout(_timer)
}
- })
+ }, [])
return (
diff --git a/npm/react/cypress/component/advanced/set-timeout-example/LoadingIndicator.jsx b/npm/react/cypress/component/advanced/set-timeout-example/LoadingIndicator.jsx
index b5efe7a250d9..f4a57d7431c6 100644
--- a/npm/react/cypress/component/advanced/set-timeout-example/LoadingIndicator.jsx
+++ b/npm/react/cypress/component/advanced/set-timeout-example/LoadingIndicator.jsx
@@ -12,7 +12,7 @@ export default function LoadingIndicator ({ isLoading, children }) {
return () => {
clearTimeout(_delayTimer)
}
- })
+ }, [])
if (isLoading) {
if (!isPastDelay) {