Can I use nativebase.io reactnative package in expo manager workflow project? - react-native

I am trying to find a dropdown related react-native package. I couldnt able to find any, which is compatible with both IOS and android devices.
So planning to use nativebase.io reactNative package.
Is it okay to use or do I face any problem?

Yes, You can use NativeBase with the expo.
Expo has its own Picker component you can use that as well which works on both platforms, Nativebase Picker is also dependent on this core module of react-native, So its recommended to use this one instead of installing a new UI lib only for Picker.
https://docs.expo.io/versions/latest/react-native/picker/

Related

Expo + Stripe CardFormField crashes on Android build

I am implementing Stripe in my React Native (Expo) app. When testing it out with ExpoGO it works well, and so does the iOS build via Testflight. However, after building the app for Android it will crash whenever the CardFormField component (provided by Stripe) is rendered.
I have logged the errors in Sentry, and this is where it goes wrong:
Binary XML file line #5 in [censored]:layout/stripe_card_form_view: Error inflating class com.google.android.material.card.MaterialCardView
IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
I then found this, here:
In order to use CardForm component, you need to install and configure Material Components theme in your app.
I do however fail to find information on how I am expected to comply with this requirement using Expo. Do anyone have any ideas?
I am using:
expo 43.0.3
#stripe/stripe-react-native 0.2.2
App is built with eas
I use expo (not an ejected app)
Thanks in advance for any help.
With Expo you have a choice between managed vs. bare workflows. In order to access the build.gradle and styles.xml files to configure the Material Components theme you need to switch to a bare workflow. You need to use expo eject to create the native Android files in question.

How do I implement Google Maps to work on Web, Andriod and iOS in React Native?

I am fairly new to React Native and I am trying to implement a map that can be used in Web, Android and iOS.
The resources I have found online, are for implementing Android and iOS with react-native-maps or just in Web with react-native-web-maps. Is there an easy way to incorporate all of them in React Native?
I am also using the Expo CLI to run the server. I have not run npm run eject to create the OS-specific files as I am trying to make the code as cross-platform as possible.
I don't know if any package works straight away for all environments but you can conditionally render map component for mobile and for web.
I have used these following packages in mobile and web versions of Expo app, they work pretty similarly and are easy to use and implement:
-mobile: #react-navigation/native
-web: #react-google-maps/api

react-native-external-display library is not supporting in expo

react-native-external-display library not supporting in expo app. facing error null is not an object (evaluating 'RNExternalDisplayEvent.SCREEN_INFO'). I would like to use a expo in the device which has two display screens so I need to display my code based on display screen.
. Please support me with your suggestions If any other library which will support my requirement. Thanks in advance.
I have not found any other library that supports an external display for React Native. Therefore using Expo may not be the best choice.
You could eject expo and then add the react-native-external-display library, which may require you to fix some errors. Alternatively you could start a new project without expo and add the library.

How to measure react native (Expo) app startup time?

I have an Expo hybrid app (Managed workflow), running on Expo SDK v37 (React Native v0.61).
I'm struggling to find the best way to measure the time it takes from the moment when the user starts the app until the splash screen disappears.
How would you approach this?
PS: I would use Firebase Performance Monitoring instead, if it was available for Expo Managed apps. But it isn't yet.
Basically I see two approaches:
For pure react-native projects you can use react-native-startup-time library.
However I'm not sure, whether you can just add this library and start to use it, since it's required linking.
But in any case you can eject your project and add this library.
If you don't want to eject expo project I can suggest you to update your project to SDK 38. It has support for RN 0.62.2 and flipper integration as well. So you can setup flipper-plugin-react-native-performance and check the performance.
I hope I helped a bit.

Expo: Can we use node modules like mqtt.js?

If Expo (create-react-native-app) is pure JavaScript, can I use other node modules in my Expo app?
in Expo, you can use any client based Javascript module, that you find in npm or that you created yourself.
But you can't use any kind of modules that has native parts in it. (Packages that you need to link to your react native projects can't be used) Although, Expo has its own SDK for your native needs.
The package you are talking about (mqtt.js) is a nodejs module, which can't be used with react native or in your case with Expo.
Just a guess, if you are trying to have a browser in your react native or Expo project, react native has a builtin in-app browser you might want to check out; https://facebook.github.io/react-native/docs/webview.html