score:0
Accepted answer
after debugging for a while , i managed to solve the issue,hope this could help other people who struggle at this.
so i accidentally connect to socket twice .
socket.current = await io(process.env.react_app_socket_port)
base on my test i think it will only connect once and after that even you can successfully passed your message, the socketid will be fixed on the orginally one , but the server will contain your last socketid.
that's why i failed to use io.to(socketid), and because i left the other connect command on other function , so i think no one can answer this question. thanks anyway!
Source: stackoverflow.com
Related Query
- React router doesn't work on express server
- How does Express and React Routes work on initial GET request from browser?
- Login React + Express + mongoDB doesn't work properly
- Fetch API work on POSTMAN and express server but does not work on React js
- REACT - Express : fetching data doesn't work on reload when user connected
- Trying to pass data from Express backend to React frontend with Axios, doesn't work
- react-router-dom doesn't work in combination of express and react
- react router doesn't work in aws s3 bucket
- How does shallow compare work in react
- How do index.js files work in React component directories?
- How to deploy a React + NodeJS Express application to AWS?
- Why does Async Await work with React setState?
- JSX React HTML5 Input Slider Doesn't Work
- React Router work on reload, but not when clicking on a link
- Maxlength does not work React Js
- React Native - npx react-native run-ios doesn't work after initializing the project
- React css transition does not work correctly
- How to Position a React Native Button at the bottom of my screen to work on multiple ios devices
- React PropTypes.oneOf to specify an enum doesn't work
- How to make react router work with static assets, html5 mode, history API and nested routes?
- How to mock ResizeObserver to work in unit tests using react testing library
- How can I make React Portal work with React Hook?
- React App with Express Backend & express-session
- react ref with focus() doesn't work without setTimeout (my example)
- How should the new context api work with React Native navigator?
- WebStorm auto completion does not work for React js
- Calling React View from Express
- Serving multiple react apps with client-side routing in Express
- Cross-Origin Request Blocked with React and Express
- Ascii/HTML character code doesn't work within React variable
More Query from same tag
- Adding file to a list that has already previously been deleted in React
- Why I can not loop through object in react-typescript
- show 2 items per row[react native]
- React router remounts children while changing routes (without reconciliation)
- Styled-JSX variables not working
- how to enable scroll bar with reactjs?
- reactjs How to pass a variable to a function inside setState
- How to correctly type a simple useReducer and Context-api in typescript
- import syntax not working with webpack
- Scrollcontainer with fixed element inside not scrollable on fixed element
- Adding colDefs dynamically
- How can I override components from another module?
- How I can pass the state and action to Redux in functional component?
- Adding new line of multiple value React JS
- Cannot access 'funct_name' before initialization works for pre-built JS functions but not component functions, Why?
- How to hide paragraph when checkbox is checked in REACTjs?
- Error while verifying token TypeError: Cannot read property 'data' of undefined firebase nodejs
- Passing onChange events through the state
- Configuring React Routes, Django URLs using Webpack
- how to change my button color based on some condition? I want less in one color and more in another color
- React dynamically create buttons that open the corresponding modal
- React/Gatsby: Conditionally wrap every two posts inside a div
- How to attach JSON data to an element to retrieve later in React?
- update the defaultValue on re
- Trying to load large json files using file-loader and webpack
- Redux form not managed by the application, with weird error
- ReactJs Newbie Getting Expected an assignment or function call and instead saw an expression no-unused-expressions
- Pseudo elements are not working in Material-UI makeStyles React.js
- React: How can this Pomodoro Clock pass the `freecodecamp tests 12 and 13`?
- reactjs - import 3 levels deep react