@legendapp/list 1.0.0-beta.51 → 1.0.0-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Legend List
1
+ # Legend List
2
2
 
3
3
  **Legend List** is a high-performance list component for **React Native**, written purely in Javascript / Typescript (no native dependencies). It aims to be a drop-in replacement for `FlatList` and/or `FlashList` with better performance, especially when handling dynamically sized items.
4
4
 
5
5
  ---
6
6
 
7
- ## ⚠️ Caution: Experimental ⚠️
7
+ ## ⚠️ Caution: Experimental ⚠️
8
8
 
9
9
  This is an early release to test and gather feedback. It's not used in production yet and needs more work to reach parity with FlatList (and FlashList) features.
10
10
 
@@ -13,7 +13,7 @@ This is an early release to test and gather feedback. It's not used in productio
13
13
  ## 🤔 Why Legend List?
14
14
 
15
15
  * **Performance:** Designed from the ground up for speed, aiming to outperform `FlatList` in common scenarios.
16
- * **Dynamic Item Sizes:** Natively supports items with varying heights without performance hits. Just provide an `estimatedItemSize`.
16
+ * **Dynamic Item Sizes:** Natively supports items with varying heights without performance hits.
17
17
  * **Drop-in Potential:** Aims for API compatibility with `FlatList` for easier migration.
18
18
  * **Pure JS/TS:** No native module linking required, ensuring easier integration and compatibility across platforms.
19
19
  * **Lightweight:** Our goal is to keep LegendList as small of a dependency as possible. For more advanced use cases, we plan on supporting optional plugins. This ensures that we keep the package size as small as possible.
@@ -21,7 +21,7 @@ This is an early release to test and gather feedback. It's not used in productio
21
21
  For more information, listen to the podcast we had on [React Native Radio](https://infinite.red/react-native-radio/rnr-325-legend-list-with-jay-meistrich)!
22
22
 
23
23
  ---
24
- ## ✨ Additional Features
24
+ ## ✨ Additional Features
25
25
 
26
26
  Beyond standard `FlatList` capabilities:
27
27
 
@@ -57,7 +57,7 @@ yarn add @legendapp/list
57
57
 
58
58
  ### Example
59
59
  ```ts
60
- import React, { useRef } from "react";
60
+ import React, { useRef } from "react";
61
61
  import { View, Image, Text, StyleSheet } from "react-native";
62
62
  import { LegendList, LegendListRef, LegendListRenderItemProps } from "@legendapp/list";
63
63
  import { userData } from "../userData"; // Assuming userData is defined elsewhere
@@ -87,17 +87,16 @@ const LegendListExample = () => {
87
87
  <LegendList<UserData>
88
88
  // Required Props
89
89
  data={data}
90
- renderItem={renderItem}
91
- estimatedItemSize={70}
90
+ renderItem={renderItem}
92
91
 
93
92
  // Strongly Recommended Prop (Improves performance)
94
- keyExtractor={(item) => item.id}
93
+ keyExtractor={(item) => item.id}
95
94
 
96
95
  // Optional Props
97
- ref={listRef}
98
- recycleItems={true}
99
- maintainScrollAtEnd={false}
100
- maintainScrollAtEndThreshold={1}
96
+ ref={listRef}
97
+ recycleItems={true}
98
+ maintainScrollAtEnd={false}
99
+ maintainScrollAtEndThreshold={1}
101
100
 
102
101
  // See docs for all available props!
103
102
  />
package/index.d.mts CHANGED
@@ -41,10 +41,8 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
41
41
  */
42
42
  drawDistance?: number;
43
43
  /**
44
- * Estimated size of each item in pixels; sufficient for most cases. If
45
- * you leave this blank, a warning should appear and you will get
46
- * a suggested size.
47
- * @required
44
+ * Estimated size of each item in pixels, a hint for the first render. After some
45
+ * items are rendered, the average size of rendered items will be used instead.
48
46
  * @default undefined
49
47
  */
50
48
  estimatedItemSize?: number;
package/index.d.ts CHANGED
@@ -41,10 +41,8 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
41
41
  */
42
42
  drawDistance?: number;
43
43
  /**
44
- * Estimated size of each item in pixels; sufficient for most cases. If
45
- * you leave this blank, a warning should appear and you will get
46
- * a suggested size.
47
- * @required
44
+ * Estimated size of each item in pixels, a hint for the first render. After some
45
+ * items are rendered, the average size of rendered items will be used instead.
48
46
  * @default undefined
49
47
  */
50
48
  estimatedItemSize?: number;