Open mbrimmer83 opened 4 years ago
Hi @mbrimmer83 thanks for reporting this bug. If you have a pull request for me I'm happy to merge.
@jsoendermann I am super busy but id love to submit one. I should be able to get one up this weekend. Stay tuned. 😄
This seems to be working for me, although I'm not sure if this is the correct way to fix it:
diff --git a/node_modules/react-native-section-list-get-item-layout/dist/index.d.ts b/node_modules/react-native-section-list-get-item-layout/dist/index.d.ts
index 8f066b8..2b2e5ea 100644
--- a/node_modules/react-native-section-list-get-item-layout/dist/index.d.ts
+++ b/node_modules/react-native-section-list-get-item-layout/dist/index.d.ts
@@ -9,10 +9,10 @@ export interface Parameters {
getSectionFooterHeight?: (sectionIndex: number) => number;
listHeaderHeight?: number | (() => number);
}
-declare const _default: ({ getItemHeight, getSeparatorHeight, getSectionHeaderHeight, getSectionFooterHeight, listHeaderHeight, }: Parameters) => (data: {
- title: string;
- data: any[];
-}[], index: number) => {
+declare const _default: ({ getItemHeight, getSeparatorHeight, getSectionHeaderHeight, getSectionFooterHeight, listHeaderHeight, }: Parameters) => (
+ data: any[] | null | undefined,
+ index: number
+) => {
length: number;
offset: number;
index: number;
If anyone could confirm, I'd be more than happy to create a PR.
Shouldn't it be something like
declare const _default: ({ getItemHeight, getSeparatorHeight, getSectionHeaderHeight, getSectionFooterHeight, listHeaderHeight, }: Parameters) => (
data: SectionListData<T>[] | null | undefined,
index: number,
) => {
length: number;
offset: number;
index: number;
};
I'm new to generics in Typescript, but this seems to work for me.
Hi guys, I went ahead and opened PR #16 for this 🎉
ping @RaphaelPI
Are there plans to merge this pr?
Is this being fixed?
For anyone else that comes across this issue, just go into his branch and copy the new code from index.ts
into your own file, then use that instead.
React-native 59 has
getItemLayout
typingLibrary type
Type error
It looks like the types for data are no longer compatible.