I want to access all classes what will be rendered with map() function. I have the next situation:
{arr.map((i, k) => {
return <div ref={car} className={`car-nr-${i.id}`} key={k}}> </div>
})}
Now i tried to access my ref.
const floor = useRef(null)
car.current.style.transform =
rotateY(10deg);
But this does not work.The styles are applying only for last element from my arr
. How to access all elements an to apply rotate
using useRef?