question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

message no showing

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
LuisRizocommented, Feb 12, 2018

I had the same problem, fixed it with thanks to @sourcesoft.

My TabNavigator now looks like: const TalentTabs = TabNavigator( { ... }, { lazy: true, ... } )

1reaction
sourcesoftcommented, Nov 9, 2017

use lazy load for your navigation. If you’re using react-navigation change lazy to true https://reactnavigation.org/docs/navigators/tab#TabNavigatorConfig

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found