I used the example and the don't work, look the video below:
https://github.com/FaridSafi/react-native-gifted-chat/tree/master/example

Show loading
Same issue here. I'm passing true to isLoadingEarlier, while waiting for response from backend, and then pass false, when i get the response. But ActivityIndicator isn't showing
Same issue here. If I set "isLoadingEarlier" initially to true, I actually see the ActivityIndicator but it won't show up when I change the state
+1
Any updates on this?
+1, please fix it
+1
when we change isLoadingEarlier in a state we also have to change the message too like
this.setState(previousState => ({
messages: GiftedChat.prepend(previousState.messages, []),
isLoadingEarlier: true,
}));
or add this property to Component
See There is prop in GiftedChat that also can solve this.
isLoadingEarlier={this.state.isLoadingEarlier}
onLoadEarlier={() => this.getMoreMessages()}
extraData={this.state}
or add this property to Component
See There is prop in GiftedChat that also can solve this.
isLoadingEarlier={this.state.isLoadingEarlier} onLoadEarlier={() => this.getMoreMessages()} extraData={this.state}
This is working! The only way I could explain it to myself (without looking to the source code) is that GiftedChat watches for the change in extraData, but doesn't listen to "our" state changes.
If we link our state to their extraData, updating state will trigger the update of the GiftedChat component.
So, just add extraData={this.state} to your <GiftedChat ... /> and it will work :)
This still needs to be fixed, though..
Also, don't forget to set loadEarlier={true}, because the ActivityIndicator (i.e. the loader) appears only if button for loading earlier messages is visible. 馃槃
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.
Most helpful comment
or add this property to Component
See There is prop in GiftedChat that also can solve this.
isLoadingEarlier={this.state.isLoadingEarlier} onLoadEarlier={() => this.getMoreMessages()} extraData={this.state}