Why is this done instead of implementing ListEmptyComponent on the FlatList? Any special reason for it?
render() {
if (this.props.messages.length === 0) {
return <View style={styles.container} />;
}
//...
RN docs: https://facebook.github.io/react-native/docs/flatlist#listemptycomponent
https://github.com/FaridSafi/react-native-gifted-chat/blob/master/src/MessageContainer.js#L121
i think is because this way is easier to handle.
But if you set refresh or load more function in the List, this coding seems cant do that.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Reopening this - this seems really bad and isn't documented. Breaks the fact that this is just a listview.
Most helpful comment
Reopening this - this seems really bad and isn't documented. Breaks the fact that this is just a listview.