From c7cfa68e2eecaab8a20f1be2ee232f0d58ee1905 Mon Sep 17 00:00:00 2001 From: Harini Malothu Date: Fri, 20 Feb 2026 00:02:57 +0530 Subject: [PATCH] Fix doc with right unmounting call --- docs/windowsbrush-and-theme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/windowsbrush-and-theme.md b/docs/windowsbrush-and-theme.md index a78c6e1d0..1408ef410 100644 --- a/docs/windowsbrush-and-theme.md +++ b/docs/windowsbrush-and-theme.md @@ -55,11 +55,11 @@ class MyAppClass extends Component { }; componentDidMount() { - Appearance.addChangeListener(this.onAppThemeChanged); + this._subscription = Appearance.addChangeListener(this.onAppThemeChanged); }; componentWillUnmount() { - Appearance.addChangeListener(this.onAppThemeChanged); + this._subscription?.remove(); }; onAppThemeChanged = (theme) => {