-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input super slow in v1.1.1 compared to v0.16.3 #2337
Comments
I have the same problem but mine is even slower. It shrinks rapidly but it grows super slowly. |
I have the same issue when upgrading to 1.1.1 |
I have the same problem, especially if I delete some of the text and type again. |
Same here. Even crashes the app sometimes.. If you need more info or help in some way please let us know @FaridSafi |
Mine is slow as well, but also when I click 'send'. Its initially quick if there's few messages in the chat, but then it gets slower and slower |
Have this issue with fresh project setup. |
Also having this issue with a fresh project setup. Lag gets increasingly worse with more messages. As a workaround, this issues goes away when I switch from Hermes engine to JSC. |
I have the same problem after upgrading to expo SDK 48. Inputting text works fine, but slows terribly when I press send or try to close the keyboard. @ZHRhodes I tried switching jsengine to JSC but didn't solve the lagging problem. |
I’m trying to debug this issue. Its partly because of the last PR that was to fix the multiline growing input field (#2323). But there seems to be a deeper problem. Why is the send button the only part of the UI that gets completely unusable? As soon as I stop typing, the button remains unusable for seconds. The more content in the chat the worse it gets. I can select text, type, play with any other part of the UI without noticeable lag but the send button is the one impacted. Anyone has an idea? |
This seems to be at cause for the unpressable send button issue: https://github.com/FaridSafi/react-native-gifted-chat/blob/master/src/Send.tsx#L62-L66 I removed the useCallbackOne and the condition around the onSend call and so far it removed the issue for me. So that function looks like:
I don't see why there is a check for text there when in fact it should be in the Please note that this is not a fully tested way to work around the issue so test it thoroughly before putting this in production. Let me know if this helps. |
giftedchat handle it's height internally, I removed this then used autogrowtextinput. it's smoother because it's does not trigger re-render giftedchat on every size change |
|
yes |
I am also experiencing it becoming really slow. For me, the chat is super smooth for the first 10 messages, but then it just slows down more and more with regards to the input and press send, after each message. |
you need to memo the message item for avoid re-render much times |
@fukemy I have the same error, I have memo message but the problem is not solved. Input grow up is only smooth when there are 20 records if there are 100 records it will lag. |
@Haianh9999, you need to config the FlatList props to avoid render to much in screen. |
@fukemy Could you give me an example? |
@fukemy Please check this video, input grow up too slow. RPReplay_Final1681271569.MP4 |
@fukemy Can you give a specific example when you use react native gifted chat library. For example sandbox links?. |
Sorry I am busy but I can give you some advices:
|
It's seem when the contentSize changed the GiftedChat re-render, so all the items inside it's re-render too, I am using rn auto grow textview to avoid it |
@fukemy On android everything works fine but on ios the input is slow to grow up. |
I have tried version |
For us the problem was within the virtualised list of react native. Maybe that is helpful for anyone |
How'd you solve it? Many months later, issue persists |
Did you fix that ? |
The answer on this thread helped me fixing the lag. |
@Rk5422686 Did you use the perf monitor? Do you have a patch? Thanks |
@Haianh9999 hi, would you like to share the code you used for the style of composer and input toolbar? I really like it |
Issue Description
Hi, i tested the new release v1.1.1. It works ok, but the input grow is super slow now (Compared with 0.16.3). The JS FPS Drop to zero.
react-native-gifted-chat version: 1.1.1 video
Screen.Recording.2023-01-25.at.06.18.48.mov
react-native-gifted-chat version: 0.16.3 video
Screen.Recording.2023-01-25.at.06.11.24.mov
Steps to Reproduce / Code Snippets
Type letters and press return in the input.
Expected Results
The JS FPS must have an average of 40 or 50 like in the v0.16.3 in order to have a good UI experience.
Additional Information
Nodejs version: v18.9.1
React version: 18.2.0
React Native version: 0.71.1
react-native-gifted-chat version: 1.1.1
Platform(s) (iOS, Android, or both?): both
The text was updated successfully, but these errors were encountered: