目标:渲染我的 firestore中具有status: false
这是我的文档结构:
Status: false
Artist: Pablo Picasso
Medium: Oil Painting
这是循环遍历 firestore 中数据的代码......
function Feed() {
const [artworks, setArtworks] = useState([]);
useEffect(() => {
db.collection("artworks").onSnapshot((snapshot) =>
setArtworks(snapshot.docs.map((doc) => doc.data()))
);
}, []);
return (
<div className="feed">
<div className="artwork__feed">
{artworks.map((artwork) => (
<FeedCard
artist={artwork.artist}
medium={artwork.medium}
/>
))}
</div>
</div>
);
}
关于如何遍历 firebase 并只呈现具有的数据的任何想法status: false?
喵喔喔
相关分类