Hello, I have 4 components that I repeat the same method and it seems like each one waits its turn to display the data. I was wondering how to fix that, I guess you're taling about that? In my original code, I have useEffect in this manner :
useEffect(() => {
ws.onmessage = function (event) {
const json = JSON.parse(event.data);
try {
if ((json.event = "data")) {
dispatch(getOrderBookData(json.data));
}
} catch (err) {
console.log(err);
}
};
//clean up function
return () => ws.close();
}, []);
What should I do to overcome the problem you mentioned?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello, I have 4 components that I repeat the same method and it seems like each one waits its turn to display the data. I was wondering how to fix that, I guess you're taling about that? In my original code, I have useEffect in this manner :
What should I do to overcome the problem you mentioned?