Skip to content

Unable to get y position of render items on Flatlist #27169

@jigarkbarot

Description

@jigarkbarot

Unable to get position of render items on Flatlist

I am trying to get an item's position in flatlist but it always returns "0".sample code are attached bellow.

Here is sample code :

<FlatList 
data={["test1","test2","test2"]}
renderItem={({item,index}) => {
return(
<View 
onLayout={(event) => {
  let {x, y, width, height} = event.nativeEvent.layout;
}}
>
<Text>{item}</Text>
</View>
)
}}
 />

Can you please help me to get out from this stuff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: FlatListNeeds: Issue TemplateThis issue does not make use of the Issue Template, and may be missing necessary information.Ran CommandsOne of our bots successfully processed a command.Resolution: For Stack OverflowA question for Stack Overflow. Applying this label will cause issue to be closed.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions