Open ralcant opened 1 year ago
hmm I think some wrong, as I know, on every text changed, GiftedChat re-render it's self by this function setText
It's using for check when either user need to re-render InputToolbar
, 'Send button`, ... etc. For better performance, you can use redux to control the text and dispatch the re-render with your condition, like this:
if (text.length) = 0 `renderEmptyView(...)` else `renderSendButton(...)`
For your question, I have the mindset like this:
GIftedChat(re-rendered)
The method renderMessageText
is function inside Bubble class, you can find them here. I think it's will not called again due to <Bubble/>
not re-render.
So please check in your code if you have something like:
shouldUpdateMessage() => {
return true
}
I have the same problem. I also use my own Message and MessageText components. Do you solve this problem?
Issue Description
I've looked at https://github.com/FaridSafi/react-native-gifted-chat/issues/2370 which supposedly fixed https://github.com/FaridSafi/react-native-gifted-chat/issues/2366, but right now I'm on latest version of this library (2.4.0) and still experiencing (useless) re renders when typing. This hinders performance as my
renderMessageText
component is a bit slow on its own (so should only be rendered once).Has this problem been solved, and if so is there a prop I have to send to avoid this behavior? Saw some issues referencing an
actionSheet
, tho I don't know how to use that (or if that solves the issue).Steps to Reproduce / Code Snippets
Expected Results
Previous messages should not rerender when one is typing a new message
Additional Information