hyochan / hyochan/react-native-masonry-list

MasonryList Component typing improvements.

Open
#52 1 comment 1 reaction 0 assignees View on GitHub
💬 discussion 1️⃣ good first issue
Dominant language
TypeScript
Stars
437
Forks
58
PR merge metrics
No merged PRs in 30d

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Here is the diff that avoid typing's warnings on props `data` and `renderItem`:

```diff
diff --git a/node_modules/@react-native-seoul/masonry-list/lib/index.d.ts b/node_modules/@react-native-seoul/masonry-list/lib/index.d.ts
index dc67ceb..980b1c6 100644
--- a/node_modules/@react-native-seoul/masonry-list/lib/index.d.ts
+++ b/node_modules/@react-native-seoul/masonry-list/lib/index.d.ts
@@ -1,5 +1,5 @@
import type { Omit, RefreshControlProps, ScrollViewProps, StyleProp, ViewStyle } from 'react-native';
-import { ScrollView } from 'react-native';
+import { ListRenderItem, ScrollView } from "react-native";
import type { MutableRefObject, ReactElement } from 'react';
import React from 'react';
interface Props extends Omit {
@@ -11,11 +11,8 @@ interface Props extends Omit {
onEndReached?: () => void;
onEndReachedThreshold?: number;
style?: StyleProp;
- data: T[];
- renderItem: ({ item, i }: {
- item: T;
- i: number;
- }) => ReactElement;
+ data: ReadonlyArray;
+ renderItem: ListRenderItem | null | undefined;
LoadingView?: React.ComponentType | React.ReactElement | null;
ListHeaderComponent?: React.ReactNode | null;
ListEmptyComponent?: React.ComponentType | React.ReactElement | null;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.