-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleOne.js
More file actions
41 lines (39 loc) · 1.15 KB
/
Copy pathExampleOne.js
File metadata and controls
41 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import { View, Text } from 'react-native';
import SectionListGrid from 'react-native-section-list-grid';
export default ExampleOne = () => {
const data = [
{
title: "Main dishes",
data: ["Pizza", "Burger", "Risotto"]
},
{
title: "Sides",
data: ["French Fries", "Onion Rings", "Fried Shrimps"]
},
{
title: "Drinks",
data: ["Water", "Coke", "Beer"]
},
{
title: "Desserts",
data: ["Cheese Cake", "Ice Cream"]
}
];
return (
<View style={{ marginTop: 50 }}>
<SectionListGrid
data={data}
numItemsRow={2}
renderItem={(subObj, subIndex) => {
<Text style={{ margin: 5, backgroundColor: 'grey' }} key={subIndex}>
{subObj}</Text>
}}
renderHeader={(obj, index) => {
<Text style={{ margin: 5, backgroundColor: 'green' }}>
{obj.title}</Text>
}}
/>
</View>
);
};