From 5c7761e9d7a684a9a074d3bc8d2f6ac95ae77222 Mon Sep 17 00:00:00 2001 From: Alexey Morozov Date: Fri, 21 Nov 2025 00:25:01 +0300 Subject: [PATCH] Fix `AnnotationSupport` not unsubscribing from `AnnotationTopic` --- CHANGELOG.md | 2 ++ src/widgets/annotation/annotationSupport.tsx | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e328868e..29a17475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to the Reactodia will be documented in this document. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +#### 🐛 Fixed +- Fix `AnnotationSupport` not unsubscribing from `AnnotationTopic` at unmount which causes tow annotations to be created from `SelectionActionAnnotate` in React development mode. ## [0.31.1] - 2025-11-18 #### 🐛 Fixed diff --git a/src/widgets/annotation/annotationSupport.tsx b/src/widgets/annotation/annotationSupport.tsx index 1d24009a..b135bb48 100644 --- a/src/widgets/annotation/annotationSupport.tsx +++ b/src/widgets/annotation/annotationSupport.tsx @@ -141,6 +141,7 @@ export function AnnotationSupport(props: AnnotationSupportProps) { batch.store(); canvas.renderingState.syncUpdate(); }); + return () => listener.stopListening(); }, []); return (