Exportieren Sie Socket IO -Verbindung in React
// service/socket.js
export const socket = socketio.connect(SOCKET_URL);
// elsewhere
import {socket} from "service/socket";
Courageous Chicken