Skip to content

"listKey" occur type error in <Flatlist/> #37212

@Eumhongin

Description

@Eumhongin

Description

continue from #37192

Flatlist listKey type error

No overload matches this call. Overload 1 of 2, '(props: FlatListProps<PersonalArtCardTypes> | Readonly<FlatListProps<PersonalArtCardTypes>>): FlatList<...>', gave the following error. Type '{ listKey: string; data: PersonalArtCardTypes[]; style: { marginTop: number; flex: number; }; columnWrapperStyle: { justifyContent: "space-between"; }; contentContainerStyle: { ...; }; ... 5 more ...; renderItem: ({ item, index }: ListRenderItemInfo<...>) => Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FlatList<PersonalArtCardTypes>> & Readonly<FlatListProps<...>>'. Property 'listKey' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<FlatList<PersonalArtCardTypes>> & Readonly<FlatListProps<...>>'. Overload 2 of 2, '(props: FlatListProps<PersonalArtCardTypes>, context: any): FlatList<PersonalArtCardTypes>', gave the following error. Type '{ listKey: string; data: PersonalArtCardTypes[]; style: { marginTop: number; flex: number; }; columnWrapperStyle: { justifyContent: "space-between"; }; contentContainerStyle: { ...; }; ... 5 more ...; renderItem: ({ item, index }: ListRenderItemInfo<...>) => Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<FlatList<PersonalArtCardTypes>> & Readonly<FlatListProps<...>>'. Property 'listKey' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<FlatList<PersonalArtCardTypes>> & Readonly<FlatListProps<...>>'.ts(2769)

스크린샷 2023-05-03 오전 10 11 30

React Native Version

0.71.7

Output of npx react-native info

System:
OS: macOS 13.2.1
CPU: (16) x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
Memory: 47.30 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.5.5 - /usr/local/bin/npm
Watchman: 2023.04.24.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.5 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.7 => 0.71.7
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

use listKey in <Flatlist/>

Snack, code example, screenshot, or link to a repository

<Flatlist listKey="some key" />

스크린샷 2023-05-03 오전 10 12 57

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions