The result should be that once I drag the element it should change the border color to pink.
I tried putting this but then it just makes the border pink on reload without dragging:
item: { id: id },
import React from 'react';
import { useDraggable } from '@dnd-kit/core';
export default function Movableimg({id,src,atext}) {
const { isDragging, attributes, setNodeRef } = useDraggable({
id: id,
type: 'image'
});
return (
<img
ref={setNodeRef}
src={src}
alt={atext}
style={{ border: isDragging ? '5px solid pink' : 'none' }}
/>
);
}`
The id,src and atext are given correctly in the other file
`{Allimages.map ((ele) =>
{
return<Movableimg key={ele.id} src = {ele.src} id = {ele.id} alt = {ele.atext}/>;
})
}