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.

extraData isn't working

See original GitHub issue

Issue Description

RenderMessage function isn’t running when data in extraData changes.

Steps to Reproduce / Code Snippets

       <GiftedChat
          messages={this.props.messages}
          renderAvatar={null}
          onSend={this.onSend}
          user={{
            _id: this.props.user._id, 
          }}
          extraData={this.state.selectedMessages}
          renderSend={this.renderSend}
          renderActions={this.renderCustomActions}
          keyboardShouldPersistTaps="never"
          renderMessage={this.renderMessage}
          renderChatFooter={this.renderChatFooter}
          renderInputToolbar={this.renderInputToolbar}
          renderComposer={this.renderComposer}
        />

Expected Results

I want renderMessage function to run when selectedMessages in state updates.

Additional Information

  • Nodejs version: 10.0.0
  • React version: 16.6.3
  • React Native version: 0.58.5
  • react-native-gifted-chat version: 0.7.2
  • Platform(s) (iOS, Android, or both?): Android

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:6

github_iconTop GitHub Comments

2reactions
antoinefotsocommented, May 22, 2020

My list only re render went I press the first or last message, other messages have no effect. Pls help

2reactions
rariracommented, Dec 27, 2019

shouldUpdateMessage prop is the way to go… it is just like react shouldComponentUpdate lifecycle method

shouldUpdateMessage = {(props, nextProps) => {
     return props.extraData.someData !== nextProps.extraData.someData
}}
Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Flatlist extraData not working redux data changed
The reason it's not updating is because you're not returning a new array. The reference is same. Return the updated state like return ......
Read more >
extraData hook not working for one of 2 flatLists-React Native
Coding example for the question extraData hook not working for one of 2 flatLists-React Native.
Read more >
Help getting extradata to cause flatlist to update : r/reactnative
So I have Task, and task are created in a new component. They simply add the information to the array that stores all...
Read more >
24/7 Backup Internet and Extra Data - Ring Help
24/7 Backup Internet 1 is a feature in Ring Protect Pro that provides internet connection to wifi-enabled devices during an internet or power...
Read more >
5 extra hours free data not working - Fido Community
To use extra data, to see your line remaining data etc etc. If you are not selected to your own number you will...
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