I am fairly new to React and React native, but I have bumped into a problem when populating a SectionList
and could not find a solution yet.
I have an array of objects, and each object has it's own array. A SectionList is ideal to display this info, however, the array for each section is not called "data", while SectionList
seems to expect the key "data" for the array in each section.
Is there a way to tell the SectionList
to use another key instead of the data key to populate each section's array?
As Per my Knowledge on SectionList each Section will Expect a data and Key .
What you can do is modify your Data as per that.
like for Eg : your data is [[1,2,3],[4,5],[6,7]]
what you can do is iterate through this array and push each subArray into New Array With Format {key:index,data:subArray}
hope this will Help :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With