Skip to content

Get ref not exist error in typescript #23

Open
@hanayashiki

Description

@hanayashiki

Try to do this:

            <FlatList
                ref={(list) => flatListRef.current = list}
            />
        );

but get:

Type '{ ref: (list: any) => any; data: Page[]; renderItem: ({ item: page }: ListRenderItemInfo<Page>) => Element; onStartReached: () => Promise<void>; onEndReached: () => Promise<...>; keyExtractor: (page: Page) => string; extraData: number; }' is not assignable to type 'IntrinsicAttributes & Omit<FlatListProps<Page>, "maintainVisibleContentPosition"> & { onEndReached: () => Promise<void>; ... 10 more ...; ListFooterComponent?: ComponentType<...>; }'.
  Property 'ref' does not exist on type 'IntrinsicAttributes & Omit<FlatListProps<Page>, "maintainVisibleContentPosition"> & { onEndReached: () => Promise<void>; ... 10 more ...; ListFooterComponent?: ComponentType<...>; }'.ts(2322)

Versions

├─ @stream-io/flat-list-mvcp@0.10.1
└─ react-native-bidirectional-infinite-scroll@0.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions