-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatlist continuous scroll heats IOS device #25775
Comments
[EDIT: I decided to repost this as a separate issue as it is in a different version, and I think is not related to scrolling: https://github.com//issues/25825] I'm not sure if it's related, but after seeing some very laggy performance with a FlatList, I made a simple test case to see how things are rendered. It seems like it was rendering repeatedly, and too much data - but I don't know how it works "under the hood", so perhaps the behaviour is expected. I am using a FlatList to render an array of 400 strings (
The Does that mean each item is re-rendered multiple times, and 226 elements are all rendered on the first page load - or is that just a "first pass" and rendering is somehow deferred? Or is the act of console.logging causing the rerenders? I'm using RN version 0.60. You can see the console.login action here: https://www.youtube.com/watch?v=kTXgZcm0cvg Also interesting, setting |
I think it might be for measuring size of each item, which can be avoided by specifying |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Flatlist scroll heats device on IOS
React Native version:
0.59.5
Steps To Reproduce
1.Created a flat list Component
2.Fetched data from api and rendered the list
Describe what you expected to happen:
The device should not get heated when scrolling up and down within the screen
class NotificationComponent extends Component {
constructor(props) {
super(props);
// All local states for read and write purposes has been declared here
this.state = {
// dashBoardData: null,
// activeSlide: 0,
notifications: [],
lazyNotifications: [],
notifcationReaded: [],
showLoader: true,
goToDetail: false,
disabledCardTap: false,
page: 0,
loading: true,
data: [],
page: 1,
seed: 1,
error: null,
refreshing: false
};
}
/* **************************
Function: componentDidMount()
Explanation:
Creator: Jose || Date: 2018-09-26
************************** */
componentDidMount() {
}
getNotification=()=>{
}
handleEnd=()=>{
}
getFlatList = () => {
// const styles = createStyle();
return (
<FlatList
data={this.state.data}
renderItem={({ item }) => (
)}
extraData={this.state}
keyExtractor={item => item.email}
onEndReached={this.handleEnd}
onEndReachedThreshold={50}
removeClippedSubviews
// ListFooterComponent={() => this.state.loading
// ?
// : null
// }
/>
)
}
render() {
// const styles = createStyle()
// const commonStyleVal = createCommonStyles()
return (
{this.getFlatList()}
);
}
}
--GLIST Item Code
import React, { PureComponent } from 'react';
import { I18nManager, Platform, View, ViewPropTypes } from 'react-native';
import PropTypes from 'prop-types';
export default class GListItem extends PureComponent {
}
The text was updated successfully, but these errors were encountered: