Customising alerts in react-native - react-native

Is there any way of customising native Alert component so it'll accept some components(like inputs and so on..) ? Please DO NOT suggest using some modals from npm and constructing something by hand, I know about these approaches...
I'm interested, if it's possible to render children components inside of native alert, because it accepts only title, message and actions and nothing else...

more than text input no and it only work for ios,from docs for ios yes(text input) alert ios,but you can't really customize it
even in native ios you can't customize it more than how is it
This is an API that works both on Android and iOS and can show static alerts. To show an alert that prompts the user to enter some information, see AlertIOS; entering text in an alert is common on iOS only.
link to it https://reactnative.dev/docs/alert

Related

Disable fill suggestions on React Native Android

when I use my application on my Android (Xiaomi), I have this kind of suggestion that appear below (or above) my TextInputs even when they are textInputs that can receive codes, postal addresses, ...
I already tried "autocomplete=off" and I saw that there was a hack with "keyboardType=visible-password" but I can't afford to use this keyboard for some fields.
How can I disable this kind of autocomplete for my TextInputs?
Thanks,
Viktor

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

How to make Chrome on Android launch my image picker rather than the system UI's in React Native?

My app is a custom image picker written in React Native using Expo, that lets a user select a particular image for uploading. When a user presses an Upload button in any third-part Web page, I want my app to open rather than the standard Android file picker dialog.
Is this possible? I'm only interested in Android at the moment. I've looked at Expo's ImagePicker, but this launches the standard Android System UI in response to a call from an app. In contrast, I need my app to open, not ImagePicker, in response to a user's click on a file upload button in a Web page.
ContentProviders looks like a promising approach, but I can't see how to use it in Expo, and I'm not sure if this is the right approach anyway.
Intents all seem to load the standard system UI image picker.
Is what I want possible, and if so, what approach should I use to achieve it?

Is AlertIOS in React Native an outdated component?

I am learning React Native and what I am learning from only talks about Alert, even for iOS. In the API/Docs I see AlertIOS and I am curious if it does something special or is lighter weight for an iOS only app than the regular Alert?
(I found no post that had a definitive answer, but all the AlertIOS posts seem to date back to 2015-ish.)
Thank you.
AlertIOS is special as it allows users to enter information into the alert using AlertIOS.prompt. According to the React Native documentation this is only a common pattern on iOS which is why they only made it available with an iOS specific API.
React Native still supports and recommends using Alert if you do not need iOS specific functionality.
From the alert docs
This is an API that works both on iOS and Android and can show static
alerts. To show an alert that prompts the user to enter some
information, see AlertIOS; entering text in an alert is common on iOS
only.
From the alertIOS docs
We recommend using the Alert.alert method for cross-platform support
if you don't need to create iOS-only prompts.

How to use AssistiveTouch UI in iOS

I'm now developing an app on iOS. With some reason, I want to use AssistiveTouch UI in my app. For example, there will display a button in my app like AssistiveTouch, if anyone press this button, four buttons will appear like AssistiveTouch, if anyone press one of there four buttons again, some action i set before will excuse.
Does apple support api about this? Or Is there any source code available?
You would have to reimplement this from scratch. There is no public API for either accessing the existing Assistive Touch feature (it has to be turned on by the user in the settings) or for creating a similar UI.