// Allows user to heart or like a post
export default function Heart({ postRef }) {
// Listen to heart document for currently logged in user
const heartRef = doc(getFirestore(), 'hearts', auth.currentUser.uid);
const [heartDoc] = useDocument(heartRef);
...
//incorrect, will reference new collection at root
const heartRef = doc(getFirestore(), 'hearts', auth.currentUser.uid);
// should be
const heartRef = doc(postRef, 'hearts', auth.currentUser.uid);
getFireStore() should be postRef
Line 9 in components/HeartButton.js (firebase-v9 branch)