Working on a React application that makes use of Firebase Firestore for handling database operations, I recently upgraded to Firebase version 9 and adopted the modular syntax for importing Firebase services.
Nevertheless, when attempting to utilize the collection method in Firestore, an error surfaced with the message "Property 'collection' does not exist on type 'Firestore'."
Below is a snippet of my code:
import React, { useRef } from "react";
import { FormEvent } from "react";
import contactcss from "./Contact.module.css";
// Remaining imports...
export default Contact;
In accordance with the migration guide, I have brought in initializeApp, getFirestore, collection, doc, and set from Firebase's modular syntax. However, the error persists despite my efforts in reorganizing imports, double-checking the Firebase configuration, and updating dependencies.
If anyone could shed light on why this issue is occurring and provide guidance on how to correctly access the collection method in Firestore using Firebase v9 modular syntax, it would be greatly appreciated.
Thank you in advance for any help!