'section list ->undefined is not an object(evaluating 'items.length')
section list -> i try to implement a section list but i got a error=undefined is not an object(evaluating 'items.length'),but i cannot find a solution
import React from 'react'; import {View, Text, SafeAreaView, SectionList} from 'react-native';
const MOVIES = [ { genere: 'DRAMA', name: [ 'Mukkabaaz ', ' Gangs of Wasseypur I ', ' Once Upon a time in Mumbai ', ], },
{ genere: 'thiller', name: [' Kaun '], },
{ genere: 'MURDER MYSTERY', name: [' Detective Byomkesh Bakshi ', ' Talaash '], },
{ genere: 'COMEDY', name: [' Hera Pheri ', 'Lage raho Munna bhai'], },
{ genere: 'ROMANCE', name: ['Love Aaj Kal', 'Love Aaj KaRockStar', 'Pyar ke side effects'], }, ];
const App = () => { return ( SectionList <SectionList sections={MOVIES} keyExtractor={(item, index) => index} renderItem={({item}) => {item}} renderSectionHeader={({section}) => {section.genere}} /> ); };
export default App;
strong text
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
