You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/V3/Overview.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ As the same as SpringScrollView,LargeList must have a bounded height in order
9
9
Props | Type | Default | Description
10
10
---- | ------ | --------- | --------
11
11
[...SpringScrollView](https://bolan9999.github.io/react-native-spring-scrollview/#/) | - | - | Support almost all props in SpringScrollView
12
-
data | { items: any[] }[] | required | The data source of the large list.
12
+
data | { items: any[] }[] | required | The data source of the large list. The outer array is the number of sections. And the inner array:`items` is the items of the section.
13
13
contentStyle | ViewStyle | { height } | The content view style of LargeList.
14
14
heightForSection | (section: number) => number | ()=>0 | The height function for every Section
15
15
renderSection | (section: number) => React.ReactElement <any> | ()=>null | The render function for every Section
* LargeList default has a `{flex:1}` style,please be sure its parent has abounded height.
40
+
* In V3, in order to maximize performance optimization, reduce the number of dom nodes, LargeList will slice the `renderHeader`,`renderFooter` and `renderIndexPath` and add some additional styles and `onLayout` prop to the root node. I think it is worth. If your items looks messy. If your Item is a single `Text`,`TextInput` or `Switch` component ,please wrapper it with a `View` , `TouchableOpacity`, `TouchableHighlight` or other.
41
+
```
42
+
renderIndexPath = ({ section, row }) => (
43
+
return <View><Text>{...}</Text></View>
44
+
)
45
+
```
46
+
47
+
* If your item has a vertical margin(marginTop or marginBottom), You should also wrapper it with a `View` , `TouchableOpacity`, `TouchableHighlight` or other.
48
+
```
49
+
renderIndexPath = ({ section, row }) => (
50
+
return <View>
51
+
<TouchableOpacity style={{margin:10}}>
52
+
{...}
53
+
</TouchableOpacity>
54
+
</View>
55
+
)
56
+
```
57
+
58
+
* If you want to return a customized component. You should always pass down the style prop that the <CustomizedComponent /> receives.
0 commit comments