yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
497 stars 256 forks source link

Doesn't work with React.strictMode #124

Closed arvid220u closed 1 year ago

arvid220u commented 1 year ago

In React strict mode, the provider will be created twice, with one of the two being destroyed immediately. This seems to make the syncing not work. My guess is that it has to do with the globals being used (e.g. messageHandlers).

If I have time to work on this I will submit a pull request!

Huly®: YJS-538

cmmartin commented 1 year ago

Can't you use memoization to prevent it from being created twice?

dmonad commented 1 year ago

This doesn't seem to be an issue that can be fixed in y-websocket. Next time, please fill out the bug report form.