@legendapp/list 3.0.0-beta.54 → 3.0.0-beta.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/list",
3
- "version": "3.0.0-beta.54",
3
+ "version": "3.0.0-beta.56",
4
4
  "description": "Legend List is a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
5
5
  "sideEffects": false,
6
6
  "private": false,
package/react-native.d.ts CHANGED
@@ -97,13 +97,11 @@ interface DataModeProps<ItemT, TItemType extends string | undefined> {
97
97
  */
98
98
  data: ReadonlyArray<ItemT>;
99
99
  /**
100
- * Function or React component to render each item in the list.
101
- * Can be either:
102
- * - A function: (props: LegendListRenderItemProps<ItemT>) => ReactNode
103
- * - A React component: React.ComponentType<LegendListRenderItemProps<ItemT>>
100
+ * Callback to render each item in the list.
101
+ * To use hooks in an item component, return that component from this callback.
104
102
  * @required when using data mode
105
103
  */
106
- renderItem: ((props: LegendListRenderItemProps<ItemT, TItemType>) => React.ReactNode) | React.ComponentType<LegendListRenderItemProps<ItemT, TItemType>>;
104
+ renderItem: (props: LegendListRenderItemProps<ItemT, TItemType>) => React.ReactNode;
107
105
  children?: never;
108
106
  }
109
107
  interface ChildrenModeProps {
@@ -234,6 +232,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
234
232
  * Style for the header component.
235
233
  */
236
234
  ListHeaderComponentStyle?: StyleProp<ViewStyle> | undefined;
235
+ /**
236
+ * Estimated height of the ListHeaderComponent. Provide this when the expected header height
237
+ * is known before layout so that only the items actually visible below the header are rendered
238
+ * on the initial frame, rather than a full screen's worth of items that are hidden behind it.
239
+ * The measured header size still replaces this value after layout.
240
+ */
241
+ estimatedHeaderSize?: number;
237
242
  /**
238
243
  * If true, auto-scrolls to end when new items are added.
239
244
  * Use an options object to opt into specific triggers and control whether that scroll is animated.
@@ -268,6 +273,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
268
273
  * @default 1
269
274
  */
270
275
  numColumns?: number;
276
+ /**
277
+ * Force RTL mode for this list instance.
278
+ * When undefined, uses React Native's global I18nManager.isRTL.
279
+ * @default undefined
280
+ */
281
+ rtl?: boolean;
271
282
  /**
272
283
  * Called when scrolling reaches the end within onEndReachedThreshold.
273
284
  */