How to use the reactfire.useFirestoreCollectionData function in reactfire

To help you get started, we’ve selected a few reactfire examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FirebaseExtended / reactfire / sample / src / Firestore.js View on Github external
const List = ({ query, removeAnimal }) => {
  const animals = useFirestoreCollectionData(query, { idField: 'id' });
  return (
    <ul>
      {animals.map(animal =&gt; (
        <li>
          {animal.commonName}{' '}
          <button> removeAnimal(animal.id)}&gt;X</button>
        </li>
      ))}
    </ul>
  );
};