import { Text, View, Image, Pressable } from ‘react-native’; import React, {useEffect,…
Jump to turn (11)
- 1import { Text, View, Image, Pressable } from ‘react-native’; import React, {useE
- 2im trying to show data from my collection Sale
- 3i change the reference field to string for image and then i have this LOG []
- 4no, its not working
- 5import { Text, View, Image, Pressable } from 'react-native'; import React, {useE
- 6okay now it shows data but still no pics also i need to add link in button from
- 7ERROR TypeError: undefined is not a function, js engine: hermes it shows after i
- 8well, it works, but what can i do with images?
- 9my imgs r uploaded in the folder in storage
- 10it works, thanks!
- 11how can i make an admin-panel where admin can add posts to the collection?
- User
import { Text, View, Image, Pressable } from ‘react-native’; import React, {useEffect, useState} from ‘react’; import { gStyle } from ‘…/styles/style’; import { firebase } from ‘…/Firebase/firebase’; import ‘firebase/compat/firestore’;
export default function Sale() { const [salesData, setSalesData]=useState([]);
useEffect(()=>{ const fetchSalesData=async()=>{ try{ const salesCollection = firebase.firestore().collection(‘Sale’); const snapshot=await salesCollection.get(); const data = snapshot.docs.map((doc)=>({id:doc.id, … doc.data})); setSalesData(data); }catch(error){ console.log('Ошибка: ', error); } }; fetchSalesData(); },[]); return ( Скидки {salesData.map((sale)=>( {sale.name} Выбрать ))}
there is no info just a button
- Assistant