From 719ae7b72fe55702c9b3f6bf5c66797dd446bbee Mon Sep 17 00:00:00 2001 From: rulikrulit Date: Tue, 1 Feb 2022 06:02:22 -0500 Subject: [PATCH] fix: reset unmounted state for the component (#4682) * Reset unmounted state for the component * update changelog Co-authored-by: ad1992 --- src/components/App.tsx | 1 + src/packages/excalidraw/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/App.tsx b/src/components/App.tsx index afbe51ee..48157d2f 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -809,6 +809,7 @@ class App extends React.Component { }; public async componentDidMount() { + this.unmounted = false; this.excalidrawContainerValue.container = this.excalidrawContainerRef.current; diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md index c1adeb78..a231cf29 100644 --- a/src/packages/excalidraw/CHANGELOG.md +++ b/src/packages/excalidraw/CHANGELOG.md @@ -68,6 +68,7 @@ Please add the latest change on the top under the correct section. ### Fixes +- Reset `unmounted` state on the component once component mounts to fix the mounting/unmounting repeatedly when used with `useEffect` [#4682](https://github.com/excalidraw/excalidraw/pull/4682). - Panning the canvas using `mousewheel-drag` and `space-drag` now prevents the browser from scrolling the container/page [#4489](https://github.com/excalidraw/excalidraw/pull/4489). - Scope drag and drop events to Excalidraw container to prevent overriding host application drag and drop events.