After chatting for some time. When user types it takes a while to appear in message input box (Delay Varies by devices);
Keep chatting for a long time with same user.
Smooth work
[FILL THIS OUT]
After chatting for some time. When user types it takes a while to appear in message input box (Delay Varies by devices);
Ok I found a solution
Commenting this line resolved performance issue.
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
https://github.com/FaridSafi/react-native-gifted-chat/issues/850
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: https://github.com/facebook/react-native/issues/18916
Commenting out the line breaks text clearing on iOS for me, this appears to resolve it well:
value={Platform.OS === 'ios' ? this.props.text : null}
+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
value={Platform.OS === 'ios' ? this.props.text : null}
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 value={Platform.OS === 'ios' ? this.props.text : null}, the box clears on Android, but it takes a second or so. If you start typing in that time (which isn't hard to do), the box won't clear at all.
Most helpful comment
Commenting out the line breaks text clearing on iOS for me, this appears to resolve it well:
value={Platform.OS === 'ios' ? this.props.text : null}