Skip to content

Commit

Permalink
chore: fix cli-style useEffect exhaustive deps warnings (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
amcgee committed Oct 4, 2022
1 parent a91dc6e commit 47fc9ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions adapter/src/components/Alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ const Alerts = () => {
)

useEffect(() => {
if (alertManagerAlerts.length > 0 || alertStackAlerts.length > 0) {
setAlertStackAlerts(
mergeAlertStackAlerts(alertStackAlerts, alertManagerAlerts)
if (alertManagerAlerts.length > 0) {
setAlertStackAlerts((currentAlertStackAlerts) =>
mergeAlertStackAlerts(
currentAlertStackAlerts,
alertManagerAlerts
)
)
}
}, [alertManagerAlerts])
Expand Down
2 changes: 1 addition & 1 deletion examples/pwa-app/src/components/VisualizationsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function VisualizationsList() {
}
}
cascadingFetch()
}, [])
}, [engine])

return (
<>
Expand Down

0 comments on commit 47fc9ff

Please sign in to comment.