22:5 Error: Missing "key" prop for element in array react/jsx-key
ShivamBunge opened this issue · 0 comments
ShivamBunge commented
./components/global/Carousel.jsx
22:5 Error: Missing "key" prop for element in array react/jsx-key
My code
import React from 'react';
import AliceCarousel from 'react-alice-carousel';
import 'react-alice-carousel/lib/alice-carousel.css';
const handleDragStart = (e) => e.preventDefault();
const responsive = {
0: {
items: 1
},
568: {
items: 2
},
1024: {
items: 3,
itemsFit: 'contain'
},
};
const items = [
<img src="/ylps1.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps2.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps3.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps4.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps5.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps6.jpg" onDragStart={handleDragStart} role="presentation" />,
<img src="/ylps7.jpg" onDragStart={handleDragStart} role="presentation" />,
];
const Carousel = () => {
return (
);
}
export default Carousel