KITFORMA · EDITORIAL GUIDE
Why does a React subscription connect twice in development?
KitForma editorial guide. When StrictMode exercises an Effect, setup can be followed by cleanup and setup again.
Step-by-step guidance
useEffect(() => subscribe(roomId), [roomId]) works when subscribe returns cleanup. Keep purchases and other user-triggered writes in event handlers. Verify that mounting, changing rooms and unmounting leave one active subscription, then zero; counting console messages alone does not establish a leak.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This starter guide was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.