Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
Reaccionar SectionList nativo no muestra datos de firebase

Estoy obteniendo una matriz de dos objetos. hay una matriz "título" y "iqtiboslar" dentro de los objetos. y muéstrelo en SectionList pero está dando un error: "no se pueden leer las propiedades de undefined (leyendo 'longitud')". ingrese la descripción de la imagen aquí Aquí está mi código. Cualquier idea será muy apreciada.

 const Item = ({iqtiboslar}) => ( <View> <Text>{iqtiboslar}</Text> </View> ); const HomeScreen = ({navigation}) => { const [quote, setQuote] = useState(); useEffect(() => { fetchQuotes(); return () => { setQuote(); }; }, []); const fetchQuotes = async () => { try { const quoteCollection = await firestore().collection('iqtiboslar').get(); // get(:field) to get specific doc quoteCollection._docs.map(doc => setQuote(doc.data().items)); // quoteCollection._docs.map(doc => console.log(doc)); } catch (error) { console.log(error); } }; return ( <View style={styles.container}> {quote ? ( <SectionList sections={quote} keyExtractor={(item, index) => item + index} renderItem={({item}) => <Item title={item.title} />} renderSectionHeader={({section}) => <Text>{section.title}</Text>} /> ) : ( <ActivityIndicator /> )} </View> ); }; export default HomeScreen; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, text: { color: 'red', }, });

datos provenientes de firebase, console.log(quote);

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba este código

 <SectionList sections={quote} keyExtractor={(item, index) => item + index} renderItem={({item}) => <Text>{item}</Text>} renderSectionHeader={({section: {title}}) => ( <Text style={styles.text}>{title}</Text> )}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!