Skip to content

[ListView] performance with more complicated renderRow #567

@go1t

Description

@go1t

I was trying to implement a real time filtering using textInput. However, the re-rendering of the ListView is incredibly slow (about 1 seconds after finish typing).

This is what the renderRow function returns: (I simplified it a lot from my real renderRow, still slow)

<View>
  <TouchableOpacity onPress={this.props.onSelect}>
    <View style={cellstyle}>
        <Image
          source={require('image!logo')}
          style={[
            styles.cellImage,
            {resizeMode: Image.resizeMode.contain}
          ]}
        />

      <View style={styles.textContainer}>
        <Text numberOfLines={2} lineHeight={1}>
          {this.props.item.name.trim()}
        </Text>
        <Text>
          {digits(this.props.item.price)}
        </Text>
      </View>
    </View>
  </TouchableOpacity>
  <View style={styles.cellBorder} />
</View>

I have tried to replace TouchableOpacity with View, but that still doesn't help improve the performance much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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