From 8a3222d947b0819c1033f8e2c6f905509d74c5ca Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Thu, 2 Feb 2023 06:46:19 -0600 Subject: [PATCH] update internal state if data prop changes --- packages/analyst/src/components/AnalystTable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/analyst/src/components/AnalystTable.js b/packages/analyst/src/components/AnalystTable.js index 030e71b..fa3e191 100644 --- a/packages/analyst/src/components/AnalystTable.js +++ b/packages/analyst/src/components/AnalystTable.js @@ -65,6 +65,10 @@ export default function AnalystTable({ loadData(); }, [url]); + useEffect(() => { + setData(initialData); + }, [initialData]); + useEffect(() => { if (!data || data.length === 0) { return; @@ -324,7 +328,7 @@ export default function AnalystTable({ {slicedData.map((row, i) => ( - + {columns.map((column) => (