firestore データベースから、データを取得したい。
react
1getPost = async (pid = "0") => { 2 try{ 3 const postRef = firebase.collection('post').doc(pid) 4 const postDoc = await postRef.get() 5 if (postDoc.exists) { 6 console.log(postDoc.id) 7 console.log(postDoc.data()) 8 console.log(postDoc.get('title')) 9 } else { 10 console.log('No such document!') 11 } 12 13 //await db.app.delete() 14 } catch (err) { 15 console.log(`Error: ${JSON.stringify(err)}`) 16 } 17 } 18 19async componentDidMount () { 20 await this.getPost(); 21 const { navigation } = this.props; 22 }); 23 }
エラー内容
invalid view found for requested tag
react native と firebaseを使うのが初めてなので。
あなたの回答
tips
プレビュー