Skip to content
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

A question about FlatList renderItem Component performance and memory usage #38

Closed
hoorsa opened this issue Oct 10, 2018 · 1 comment
Closed

Comments

@hoorsa
Copy link

hoorsa commented Oct 10, 2018

Hi,
I'm a react-native newbie.
Just a question about FlatList renderItem Component performance and memory usage.

Which of below renderItem Components is faster in performance and which is memory friendly for a large list?

1:

class MyListItem extends React.PureComponent {
  render() {
    return (
     <View style={{width: '100%', height: 60}}>
       {
         this.props.size ===  30 ?
         (
           <View style={{width: 30, height: 30}}>
                <Text>test</Text>
           </View>
         )
         :
         null
       }
       <View>...</View>
     </View>
    )
  }
}

2:

class MyListItem extends React.PureComponent {
  render() {
    return (
         <View style={{width: '100%', height: 60}}>
           <View style={{width: this.props.size, height: this.props.size}}>
                <Text>test</Text>
           </View>
           <View>...</View>
         </View>
    )
  }
}

Thanks.

@satya164
Copy link
Member

Hey, this repo is for discussions and proposals regarding changes in React Native. It's not intended for questions. So I'm closing it. Please use appropriate channels such as stack overflow and reactiflux for your questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants