File tree Expand file tree Collapse file tree 1 file changed +30
-27
lines changed Expand file tree Collapse file tree 1 file changed +30
-27
lines changed Original file line number Diff line number Diff line change @@ -84,33 +84,36 @@ Here is the view of the solution
84
84
85
85
Here is the final code with ** ListHeaderComponent** props function
86
86
87
- // Header function
88
- function gearHeader() {
89
- return (
90
- <View style={styles.titleHolder}>
91
- <Text style={styles.myGearText}>My Gear</Text>
92
-
93
- <View style={styles.iconRow}>
94
- <TouchableOpacity
95
- onPress={() => openCameraCameraRoll(IMAGE_FOR.FIELD_GEAR)}>
96
- <Icon name={'camera'} type={'entypo'} size={25} color="grey" />
97
- </TouchableOpacity>
98
- </View>
99
- </View>
100
- )
101
- }
102
-
103
- // FlatList "ListHeaderComponent" props
104
- return (
105
- <FlatList
106
- data={gearPhotos}
107
- keyExtractor={(item) => item._id}
108
- numColumns={3}
109
- ListHeaderComponent={gearHeader}
110
- showsVerticalScrollIndicator={false}
111
- renderItem={renderItem}
112
- />
113
- )
87
+ ``` javascript
88
+ // Header function
89
+ function gearHeader () {
90
+ return (
91
+ < View style= {styles .titleHolder }>
92
+ < Text style= {styles .myGearText }> My Gear< / Text >
93
+
94
+ < View style= {styles .iconRow }>
95
+ < TouchableOpacity
96
+ onPress= {() => openCameraCameraRoll (IMAGE_FOR .FIELD_GEAR )}
97
+ >
98
+ < Icon name= {" camera" } type= {" entypo" } size= {25 } color= " grey" / >
99
+ < / TouchableOpacity>
100
+ < / View>
101
+ < / View>
102
+ );
103
+ }
104
+
105
+ // FlatList "ListHeaderComponent" props
106
+ return (
107
+ < FlatList
108
+ data= {gearPhotos}
109
+ keyExtractor= {(item ) => item ._id }
110
+ numColumns= {3 }
111
+ ListHeaderComponent= {gearHeader}
112
+ showsVerticalScrollIndicator= {false }
113
+ renderItem= {renderItem}
114
+ / >
115
+ );
116
+ ```
114
117
115
118
## What next?
116
119
You can’t perform that action at this time.
0 commit comments