Skip to content
Advertisement

Tag: reactjs

Get src of dropped image from event target

I have a list of images that i can drap and drop, when dragging starts on image i store it’s URL in a state like this: When dropping it i use that state URL to display the image: But I was wondering if I could use the event e produced by onDrop to get the URL of the image, without

Calling async function in .map() (React)

I’m trying to iterate over IDs (track.id) and for each of them fetch some data (based on those IDs) from API (getBPM()). I’m pretty sure it’s connected with Promises and I’m not very fluent with these yet. Here’s the code: I’ve tried some things, but couldn’t get it to work. I’d appreciate any kind of help Answer When you call

Tailwindcss not rendering in ExpressJS/React app

I am trying to add TailwindCSS to my existing Express JS + React application. I have tried many different tutorials, such as this one https://tailwindcss.com/docs/installation for regular JS, and this one made specifically for Create-React-App https://tailwindcss.com/docs/guides/create-react-app . I later tried this tutorial for express js https://daily.dev/blog/how-to-use-tailwindcss-with-node-js-express-and-pug My project was initially made with Create-React-App, but I later changed everything to run

Why React js receive multiple answer from server with Socket.io?

When emit a event to the websocket server, the server receive the event once and send a response, but the client receive the event multiple time: result expected result received client side: server side : Answer UPDATE: on the client side I got to put the socket.on(‘response,()=>{…}) in the UseEffect of the component and add a socket.off in the return

How to update large JSON objects? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 months ago. Improve this question The server sends me a data as JSON to descripe a product. A product consists of properties and nested arrays of properties, up to 4

Advertisement