error while updating property of 'selection' of a view managed by: androidTextInput - react-native

Getting following error on android, IOS work fine,
Using React Native Version 0.43.4
error while updating property of 'selection' of a view managed by:
androidTextInput

https://github.com/facebook/react-native/pull/22723
Please upgrade to the latest react native version as it has recently been updated with this pull request
Here's a work around if you cannot update RN:
https://github.com/akalin-keybase/rn-text-input-bugs/blob/master/App.js.
Basically this enforces the selection change before text change (whenever rerendering is called) see _onButtonPress() in the github page above.

Related

Create a custom date picker with react native and expo

I would like to create a box to select the date as in the attached photo.
What do you recommend to create something similar in react native with expo?
I tried using MUI's Mobile DatePicker API, but it doesn't work, errors occur.
Update:
I created this box to select the date, but when I go to press it gives me an error.
The error is the following:
https://www.npmjs.com/package/#react-native-community/datetimepicker
Works with Expo. Static version set at 3.x.x (something version 3). So you won't have the full functionality that is described on their docs, but you'll have enough.
expo install #react-native-community/datetimepicker
instead of npm to ensure you get the compatible version.
This library can be a bit difficult to work with. The main suggestion I have for you is to create a custom component on your own that looks like your design. Then wrap it with a TouchableOpacity and onPress set the DateTimePicker to show its modal. Grab the value you need from the onChange result, and pass it to your local state. Dont try anything fancy after that because as I mentioned earlier, the library is difficult to work with and really fights hard against any customization. It works well though and will certainly solve your problem.

Unknown event handler property 'onTextLayout'

I've looked it up on reactnative.dev, and the Text component is supposed to have an 'onTextLayout' prop.
I'm running the React Native version 0.62.2, and the documentation on their site says it applies for 0.62. However, when I try to use the prop in a Text component, I am shown this message:
I need to use this prop to detect when the text starts overflowing into two lines. If anyone has another solution of how I can accomplish this without onTextLayout, that would also be very helpful.
It appears it's not working on react-native-web
http://necolas.github.io/react-native-web/docs/?path=/docs/components-text--children
Just test your app on android/iOS and you will be fine

Getting a warning with getNodes in React Native

It is warning today my React Native got updated to 0.62 before i was not getting any of this warning.
Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release. React Native Fiber Host Component
in SafeView (at withOrientation.js:54)
If you are using ref.getNode() in your code, remove .getNode() part. If not then the warning is coming from one of the libraries that are not yet updated for react-native 0.62. Give it some time and then update your libraries. In the meantime you can safely disable this warning with console.ignoredYellowBox = ['Calling getNode()'] statement somewhere in your App.js

Can we use Kendo-React UI in React-Native?

I want to use Kendo UI React with my React Native application but I got some problems with the getting started.
I followed every step inside https://www.telerik.com/kendo-react-ui/getting-started/ but I encounter this error : "Invariant Violation: View config not found for name button"
So is there a way to use it in my react native mobile application ?
Kendo React canĀ“t be implemented in React native at the moment. Telerik is considering since August last year to implement it according to market demand.
https://www.telerik.com/forums/is-it-possible-to-use-kendo-ui-react-with-a-react-native-mobile-application
You should consider a different UI library or stack for your project.
Nativescript can be a valid option depending on your needs.
https://blog.jscrambler.com/react-native-vs-ionic-vs-nativescript-a-practical-guide/

ToastAndroid showWithGravity Error

Following the document, I am including a toast in my projects:
import {ToastAndroid} from react-native
ToastAndroid.showWithGravity('A toast with gravity',ToastAndroid.SHORT,ToastAndroid.TOP);
But I got an error:
However, if I replace it with another function, it works:
ToastAndroid.show('A toast without gravity',ToastAndroid.SHORT);
I am using React Native 0.30.0
Is it a bug or I made the wrong way to use it.
ToastAndroid.showWithGravity(...) was implemented in ReactNative 0.31.0, upgrade your RN version.
First implemented here: v0.31.0-stable branch.