目标:渲染我的 firestore中具有status: false这是我的文档结构:Status: falseArtist: Pablo PicassoMedium: 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?
添加回答
举报
0/150
提交
取消