Skip to content

Example using ScrollToEnd #40

Description

@edoofx
```
<OptimizedFlatList
      ref={ref => (this._listRef = ref)}
      onContentSizeChange={() => {
        this._listRef.scrollToEnd();
      }}
      style={styles.list}
      data={this.state.chat}
      keyExtractor={(item, index) => index.toString()}

      renderItem={message => {
        const item = message.item;
        let inMessage = item.type === 'in';
        let itemStyle = inMessage ? styles.itemIn : styles.itemOut;

        return (
          <View key={item} style={[styles.item, itemStyle]}>
            {!inMessage && this.renderDate(item.datetime)}
            <View style={[styles.balloon]}>
              <Text>{item.message}</Text>
            </View>
            {inMessage && this.renderDate(item.datetime)}
          </View>
        );
      }}
    />

before im using Optimizedflatlist , im using flatlist react native and method scroll like that .. but not working with optimizedflatlist , 

scrolltoend is not a function..

help

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions