skip to Main Content

no socket io connection being made – Reactjs

All versions installed of socket.io and socket.io-client are the same in my mern app. Here is my server code: const app = express(); mongoose.connect(MONGOOSE_URL, { useNewUrlParser: true, useUnifiedTopology: true, }).then(() => { console.log(`MongoDB connected successfully`); }).catch((error) => console.log(`${error} did not…

VIEW QUESTION

Resolve promise.all inside a useEffect – Javascript

I have a simple useEffect in my component to fetch data from 3 API calls: useEffect(() => { Promise.all([ fetch(`${baseUrl}/counts?entity=color`), fetch(`${baseUrl}/counts?entity=brand`), fetch(`${baseUrl}/counts?entity=category`) ]).then(([x, y, z])=> { console.log(x.json(), y.json(), z.json()); }); }, []); I'm expecting the actual data I get from…

VIEW QUESTION
Back To Top
Search