This is the view of my database:
import React, { useState } from "react";
import { db } from "../firebase";
import { collection, Firestore, getDocs } from "firebase/firestore";
function Document() {
const handleFetchData = async () => {
//What should I Write to get the documents from Kids collection
};
}
return (
<div>
<button onClick={handleFetchData}> Fetch Data </button>
</div>
);
export default Document;
I want to get the innermost document (document of Kids collection) by just clicking on the button
2
Answers
Actually the correct solution is this after firebase 9
Try once with following code: