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

Because you do never change the state of GameRoom. You only change the state of Main. States are not share between components. Each stateful component has its own state.

I guess you just need to practice react a bit more first.