rusackas commented on code in PR #39893:
URL: https://github.com/apache/superset/pull/39893#discussion_r3193059257


##########
superset-frontend/src/embedded/index.tsx:
##########
@@ -196,7 +196,11 @@ function start() {
       if (!root) {
         root = createRoot(appMountPoint);
       }
-      root.render(<EmbeddedApp />);
+      root.render(
+        <StrictMode>
+          <EmbeddedApp />
+        </StrictMode>,
+      );

Review Comment:
   Good catch — fix pushed in 04dcd888f8. The `store.subscribe` was inside the 
render body without cleanup, which (independently of StrictMode) leaked a new 
subscription on every re-render. Moved it into a `useEffect` keyed on 
`emitDataMasks`, returning the Redux unsubscribe so it tears down on unmount 
and on the StrictMode dev-mode double-mount. The pre-existing latent leak is 
now fixed too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to