feat(chat): maxToRenderPerBatch

This commit is contained in:
Xavier Carpentier
2018-01-25 15:11:11 +01:00
parent 505d74908b
commit 8ccbcd03e5
3 changed files with 6 additions and 3 deletions

View File

@@ -8,3 +8,4 @@ export const MAX_COMPOSER_HEIGHT = 200;
export const DEFAULT_PLACEHOLDER = 'Type a message...';
export const DATE_FORMAT = 'll';
export const TIME_FORMAT = 'LT';
export const MAX_RENDER_ITEM = 10;

View File

@@ -15,6 +15,7 @@ import sum from 'hash-sum';
import LoadEarlier from './LoadEarlier';
import Message from './Message';
import { MAX_RENDER_ITEM } from './Constant';
export default class MessageContainer extends React.PureComponent {
@@ -103,9 +104,9 @@ export default class MessageContainer extends React.PureComponent {
keyExtractor={(item) => item._id}
enableEmptySections
automaticallyAdjustContentInsets={false}
initialNumToRender={10}
maxToRenderPerBatch={10}
windowSize={10}
initialNumToRender={MAX_RENDER_ITEM}
maxToRenderPerBatch={MAX_RENDER_ITEM}
windowSize={MAX_RENDER_ITEM}
removeClippedSubviews
inverted={this.props.inverted}
{...this.props.listViewProps}

View File

@@ -5,6 +5,7 @@ Object {
"DATE_FORMAT": "ll",
"DEFAULT_PLACEHOLDER": "Type a message...",
"MAX_COMPOSER_HEIGHT": 200,
"MAX_RENDER_ITEM": 10,
"MIN_COMPOSER_HEIGHT": 33,
"TIME_FORMAT": "LT",
}