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 = props => {
const database = useDatabase();
const ref = database().ref('animals');
const changes = useDatabaseList(ref);
const addNewAnimal = commonName => {
const newAnimalRef = ref.push();
return newAnimalRef.set({
commonName
});
};
const removeAnimal = id => ref.child(id).remove();
return (
<>
<ul>
{changes.map(({ snapshot }) => (</ul>