I'm getting a warning to use a "key" prop but am using the key prop in my CatList component. See below:
import React from 'react';
import PropTypes from 'prop-types';
import {Link} from 'react-router-dom';
const CatList = ({cats}) => {
return (
<ul className="list-group">
{cats.map(cat =>
<li className="list-group-item" key={cat.id}>
<Link to={'/cats/' + cat.id}>{cat.name}</Link>
</li>
)}
</ul>
);
};
CatList.propTypes = {
cats: PropTypes.array.isRequired
};
export default CatList;
Any idea why I am still getting this React warning?