Skip to content

Example using ScrollToEnd #40

@edoofx

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

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