How do I play online with react js + phaser 3 + socket.io?

Since you ask me directly, I assume you are refering to my phaser react example.

This is not how I would recommend getting and setting the react state. I would pass the phaser scene to the react component and access the state via event emitter.