Create FlatList in React-Native Expo
I want display list like image below:
How to do that … ?
Create a filename listDoa.js inside views folder and add this code:
- class ListDoa extends Component, this code is for making a class Component called ListDoa
- export default is used to export this ListDoa Component so later can be imported
- style attribute is used to give CSS style to element
- renderItem is a function to takes an item from data and renders it into the list.
Open App.js and modify the content like this:
- import ListDoa from ‘./views/listDoa’, this code is used to import ListDoa Component from listDoa File inside views folder
- <ListDoa /> is to called ListDoa Component
Run the app with command expo start
Thanks for Reading