-
-
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
[Performace] After chatting for a while input box start taking delay to show typed message in input box. #840
Comments
Ok I found a solution Issue: When user enter large text (50+ characters) and remove it then repeat process again 2 or more times. Then composer freeze Removing/commenting that line resolved that issue |
@FaridSafi Please add this solution in readme. This might help other users. |
@Suraj-Tiwari Thanks so much for this, i have this problem too. My issue on Lag |
Same here! I don't understand though why this is fixing the problem. 🤔 Isn't this the exact way that react-native recommends doing TextInput? How can it slow down Android?https://facebook.github.io/react-native/docs/textinput.html |
I think what is happening that each time input changes, it is set to the state of the parent gifted chat. This causes every single component under giftedChat to be rerendered, because the text is passed as prop everywhere. On iOS this doesn't seem to be an issue, but on Android the rerendering is quite slow. If this is true, it is a rather fundamental problem with the package. |
Possibly related issue: facebook/react-native#18916 |
Commenting out the line breaks text clearing on iOS for me, this appears to resolve it well:
|
+1 Without this my JS and UI FPS drop to about 3fps while typing. with this fix applied they stay at about 50fps |
simply comment " value={this.props.text} " in Composer.js file inside react-native-gifted-chat node module folder |
No pull request for this? |
@ahartzog, if make the change you suggested
the input field no longer gets cleared when I submit a message. Does this not happen for you? I'm on version 0.4.3. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
With the suggested fix of |
該問題似乎在RN 0.56之後已被修復,不須更改react-native-gifted-chat,所以可以考慮升級RN後改回來 Ref: FaridSafi#840 FaridSafi#926 facebook/react-native#19126 facebook/react-native@1b4187f
Issue Description
After chatting for some time. When user types it takes a while to appear in message input box (Delay Varies by devices);
Steps to Reproduce / Code Snippets
Keep chatting for a long time with same user.
Expected Results
Smooth work
[FILL THIS OUT]
Additional Information
After chatting for some time. When user types it takes a while to appear in message input box (Delay Varies by devices);
The text was updated successfully, but these errors were encountered: