message no showing
See original GitHub issueI just added this module, and I try the example to send some message. But nothing is showing up in the screen (no bubble no text), I console.log(this.state.messages);
inside the render
function, array of message is there.
Example I used:
import { GiftedChat } from 'react-native-gifted-chat';
class Example extends React.Component {
state = {
messages: [],
};
componentWillMount() {
this.setState({
messages: [
{
_id: 1,
text: 'Hello developer',
createdAt: new Date(),
user: {
_id: 2,
name: 'React Native',
avatar: 'https://facebook.github.io/react/img/logo_og.png',
},
},
],
});
}
onSend(messages = []) {
this.setState((previousState) => ({
messages: GiftedChat.append(previousState.messages, messages),
}));
}
render() {
return (
<GiftedChat
messages={this.state.messages}
onSend={(messages) => this.onSend(messages)}
user={{
_id: 1,
}}
/>
);
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (5 by maintainers)
Top Results From Across the Web
Fix problems sending, receiving or connecting to Messages
Make sure your phone has background data turned on for the Messages app. Open your device's settings. Tap Network & internet and then...
Read more >6 Ways to Fix “Android Messaging App Not Working” Issue
How to Fix “ Message App Not Working” on Android · Tip 1. Restart Your Android Phone · Tip 2. Force Stop Message...
Read more >Is your messaging app not working? Try these fixes
Is your messaging app not working? Try these fixes · Outages and reception · Is Airplane mode on? · Restart the phone to...
Read more >Android Messages App Not Working? 12 Fixes to Try
1. Force Close and Reopen Messages · 2. Close Unneeded Applications · 3. Set Messages as Default Texting App · 4. Clear the...
Read more >If you can't send or receive messages on your iPhone or iPad
You can set up Messages so that it automatically tries to send messages as an SMS when iMessage isn't available. Go to Settings...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem, fixed it with thanks to @sourcesoft.
My TabNavigator now looks like:
const TalentTabs = TabNavigator( { ... }, { lazy: true, ... } )
use lazy load for your navigation. If you’re using
react-navigation
changelazy
to true https://reactnavigation.org/docs/navigators/tab#TabNavigatorConfig