Jirat Ki.
Jirat Ki.
That is because `React.StrictMode` renders the component twice (as it is [intentional](https://github.com/facebook/react/issues/15074#issuecomment-471197572)), that causes 2 connections get created. Create a ws connection inside `useEffect` and close on the effect cleanup...
I have submitted a PR to fix this issue in #9934
@alpeer Upgrade React 17 and remove `import React` statements won't work since React doesn't do any JSX transform, you need babel plugin for that (https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#manual-babel-setup). --- the CRA ejection issue...