[ListView] renderRow pass state to prop
See original GitHub issueHi all, I’m trying to set scrollY prop with a state value updated by the onscroll function. Is this the correct way of doing this? I need to pass the scrollY offset to my component. I’m able to get a value on my component but it doesn’t update as I scroll.
renderRow: function (rowData, sectionID, rowID) {
return (
<VideoCard key={rowData.id} data={rowData} rowid={rowID} autoplay={this.state.autoplay} scrollY={this.state.contentOffset} navigator={this.props.navigator}/>
);
},
Issue Analytics
- State:
- Created 8 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
ListView renderRow pass state to prop - Stack Overflow
I'm trying to set scrollY prop with a state value updated by the onscroll function. Is this the correct way of doing this?...
Read more >ListView - React Native
renderRow ... Takes a data entry from the data source and its ids and should return a renderable component to be rendered...
Read more >ListView | React Native By Example - Packt Subscription
The renderRow function takes data from the dataSource of your ListView and returns a component to render for each row of data in...
Read more >Display a List Using the FlatList Component in React Native
state.isChanged} prop to re-render a FlatList component by updating the value of isChanged property.
Read more >React Native ListView Component - GeeksforGeeks
Thus, the ListView Component is an abstraction that optimizes the ScrollView Component. Syntax: <ListView dataSource={} renderRow={} />.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@arilitan glad it worked! yeah it definitely does take a performance toll - i ended up writing a debounce function.
Like this:
You can read more about this here - http://stackoverflow.com/questions/23123138/perform-debounce-in-react-js
will try that, thanks again!