Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: triggers a re-render on useEffect when data loads
Browse files Browse the repository at this point in the history
  • Loading branch information
yosephAHMED committed Aug 18, 2020
1 parent 29a603e commit 699be8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/incidents/visualize/VisualizeIncidents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const VisualizeIncidents = () => {
if (data === undefined || isLoading) {
console.log('data is undefined')
} else {
console.log('data:', data)
let incidentMonth: string
const totalIncidents: number = data.length
for (let incident = 0; incident < totalIncidents; incident += 1) {
Expand All @@ -57,7 +58,7 @@ const VisualizeIncidents = () => {
console.log('incidentMonth: ', incidentMonth)
}
}
}, [])
}, [data])

// if (data === undefined || isLoading) {
// return <Spinner type="DotLoader" loading />
Expand Down

0 comments on commit 699be8c

Please sign in to comment.