From 1473f792fcbc6c693a813534cc76348daa0d04be Mon Sep 17 00:00:00 2001 From: Alex Rock Date: Fri, 26 Apr 2024 11:15:55 -0600 Subject: [PATCH] fix: BugWithReusingSpace (#100) * feat: include id from props not config * chore: changeset * Update .changeset/funny-shirts-argue.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .changeset/funny-shirts-argue.md | 5 +++++ apps/react/app/re-used-space/App.tsx | 2 +- packages/react/src/components/Space.tsx | 9 ++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/funny-shirts-argue.md diff --git a/.changeset/funny-shirts-argue.md b/.changeset/funny-shirts-argue.md new file mode 100644 index 00000000..10635082 --- /dev/null +++ b/.changeset/funny-shirts-argue.md @@ -0,0 +1,5 @@ +--- +'@flatfile/react': patch +--- + +Fixes bug with re-using spaces. diff --git a/apps/react/app/re-used-space/App.tsx b/apps/react/app/re-used-space/App.tsx index 70189e57..a481ea33 100644 --- a/apps/react/app/re-used-space/App.tsx +++ b/apps/react/app/re-used-space/App.tsx @@ -93,8 +93,8 @@ const App = () => { { - const { config, children } = props + const { config, id, children } = props const { updateSpace } = useContext(FlatfileContext) const callback = useCallback(() => { - updateSpace(config) + updateSpace({ + ...(config || {}), + id, + }) }, [config, updateSpace]) useDeepCompareEffect(callback, [config])