I have a chat app for iOS and Android - basic layout with a list of messages and an input field to type and send a message. After a few dozen messages come in typing gets very slow. The list scrolling still works smoothly though.
I checked with the iOS memory tools and it reports that I don't have a memory leak. On Android systrace, it shows that deliverInputEvent
takes over 300ms.
How to I figure out what makes deliverInputEvent
take so long?
Just show a view beneath the TextInput that will contain a list of matching words with the input text, and you can control that views visibility when user selects a word from the list. Dont forget to make it absolute.
To solve the issue of being unable to type in an input field in React, make sure to use the defaultValue prop instead of value for uncontrolled input fields. Alternatively, set an onChange prop on the field and handle the change event.
Launch time. Slow app launch is another issue of React Native apps. If your app opens too slowly, you probably have too many dependencies in your app and you're using slow components. Try to use fast, high-performance components and decrease the number of dependencies in your app.
Use the maxLength prop to set a character limit on an input field in React, e.g. <input maxLength={5} /> . The maxLength attribute defines the maximum number of characters the user can enter into an input field or a textarea element.
Seems like a bug in React Native: https://github.com/facebook/react-native/issues/19126
I have the same app and the same problem. In my case, the TextInput becomes slow when starting typing. I noticed that autocorrect takes some time to suggest words on the keyboard and so I turned it off. Now it works better. I know it's not the best solution, but ... ¯ \ _ (ツ) _ / ¯
autoCorrect={false}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With