My memory is hazy since it's been a while, but I implemented collaborative editing in TipTap using YJS. This requires coordinating editor state with a socket interface and I had to use a bunch of useEffect trickery to make sure the state didn't get out of sync. I'm afraid I can't elaborate further, but I will say that I'd highly recommend TipTap if you want to build collaborative editing. Once I got it working, it worked perfectly.