I am really confused as I don't understand how to pass an array to the SectionList. When I try this one everything is ok
<SectionList
renderItem={({item}) => <View><Text> title={item.title}</Text></View>}
renderSectionHeader={({section}) =>
<View><Text> title={section.key}</Text></View>}
sections={[
{data: [{title:123},{title:"aaa"}], key: "aaa"},
data: [{title:333},{title:"bbbb"}], key: "bbb"},
{data: [{title:123},{title:"aaa"}], key: "ccc"},
]}
/>
But if I try to use a function (as I understand it is totally the same), I got an error "props.sections.reduce is not a function". How to pass an array with function to the SectionList? Thanks
sections={()=>[
{data: [{title:123},{title:"aaa"}], key: "aaa"},
data: [{title:333},{title:"bbbb"}], key: "bbb"},
{data: [{title:123},{title:"aaa"}], key: "ccc"},
]}
/>