Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Animals = ({ serverAnimals }) => {
let initialAnimals = deserialize(serverAnimals);
let animals = initialAnimals;
if (firebase.apps.length) {
animals = useFirestoreCollection(
firebase.firestore().collection('animals'),
{ startWithValue: initialAnimals }
);
}
return (
<ul>
{animals.docs.map(animal => (
<li>name: {animal.data().commonName}</li>
))}
</ul>
);
};