From e1a5e5f0901fb6c8cb6125397a7cc96406b905a7 Mon Sep 17 00:00:00 2001 From: Amit Singh Kushwaha <136868174+AmitSingh-5600@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:35:36 +0530 Subject: [PATCH] Fix: Clear correct timeout variable in componentWillUnmount Fixed a bug in fixtures/attribute-behavior/src/App.js where componentWillUnmount was checking for this.timeout but clearing this.interval (which doesn't exist). This caused a memory leak where timeouts weren't properly cleaned up on unmount, and could lead to React warnings about setState on unmounted components. Changed clearTimeout(this.interval) to clearTimeout(this.timeout) to match the conditional check and the rest of the component's timeout handling. Co-authored-by: Cursor --- fixtures/attribute-behavior/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures/attribute-behavior/src/App.js b/fixtures/attribute-behavior/src/App.js index ad6e863e1fa0..8234235923ab 100644 --- a/fixtures/attribute-behavior/src/App.js +++ b/fixtures/attribute-behavior/src/App.js @@ -602,7 +602,7 @@ class Result extends React.Component { componentWillUnmount() { if (this.timeout) { - clearTimeout(this.interval); + clearTimeout(this.timeout); } }