From 699be8c436122de63972db3bd4d9e90ebbfc06aa Mon Sep 17 00:00:00 2001 From: Yoseph Ahmed Date: Mon, 17 Aug 2020 23:15:40 -0400 Subject: [PATCH] feat: triggers a re-render on useEffect when data loads --- src/incidents/visualize/VisualizeIncidents.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/incidents/visualize/VisualizeIncidents.tsx b/src/incidents/visualize/VisualizeIncidents.tsx index e9b4f16de9..a401eaca7e 100644 --- a/src/incidents/visualize/VisualizeIncidents.tsx +++ b/src/incidents/visualize/VisualizeIncidents.tsx @@ -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) { @@ -57,7 +58,7 @@ const VisualizeIncidents = () => { console.log('incidentMonth: ', incidentMonth) } } - }, []) + }, [data]) // if (data === undefined || isLoading) { // return