Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const List = ({ query, removeAnimal }) => {
const animals = useFirestoreCollectionData(query, { idField: 'id' });
return (
<ul>
{animals.map(animal => (
<li>
{animal.commonName}{' '}
<button> removeAnimal(animal.id)}>X</button>
</li>
))}
</ul>
);
};