Can I use Expo Packages (such as expo-linear-gradient or expo-mail-composer) Without actually running my app on Expo - react-native

Title sums up the question. I do not want to deal with all of the extra drama that surrounds building a full expo app, but using some of their dependencies might help

You can use Expo APIs in any React Native App. The same goes for the mentioned packages.

Related

Make a react native app which not use expo run on web

I have a react-native App which is not using Expo and runs on android and iOS. Is it possible to make it run on Web? I found multiple projects for this purpose but I am not sure if those projects are aimed to be used only with Expo projects or not. I use multiple android and iOS modules in my app, I can't imagine how those modules will be converted to run on web. Any advise? Is what I am trying to do is even possible?
If you're using native modules with android or IOS specific functionality then you'll have to find a replacement that supports web, (or keep them and use something else for web).
Also no need to stay away from expo modules, expo modules can be used outside of expo too, here's how you can set them up: https://docs.expo.dev/bare/installing-expo-modules/
I'd suggest you listen to some of Fernando Rojo's talks about this:
https://www.youtube.com/watch?v=0FfvIuSouTU&ab_channel=SoftwareMansion

How to get device Id in expo react native app

I am implementing API to connect app with server. I have to use deviceId there. As mentioned in here we can use third party library 'react-native-device-info'. But when I am using it I am getting errors as attached screenshots. As per error it's saying to do linking but as I am using react version 0.62, so autolinking is there. So What can be issue? It took too much time to search it but till now I didn't get a proper solution.
react-native-device-info library wont work in Expo , since it requires linking of native modules hence the error.It will only work in pure react native apps.
You can check this by expo itself : expo-device
hopeit helps.feel free for doubts
You can use react-native-device-info even in Expo projects. You need to replace Expo Go with a custom build that has react-native-device-info library baked in.
By default, Expo Go used on Android, iPhone Emulators implies managed workflow (aka only expo-* modules are being used). However, using any pure react-native-* libraries falls under bare workflow, so you cannot use Expo Go - the error you see is from Expo Go, not your app.
Build your custom Expo app with expo-dev-client, react-native-device-info libraries included, and install that on your emulators. This needs to be done once when you add a react-native-* library.
Now continue to add code to your project that uses features from react-native-device-info.
npx expo start --dev-client and choose your emulator. Your custom build will be launched and you can make live changes as always like in Expo Go.
Do check out the section on Development Builds from Expo. Needless to say, I have successfully used react-native-device-info on my Expo project, because expo-device cannot provide what I needed.

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.

Using Exp development workflow with a pure react-native application

Might be a duplicate, didn't find one tho.
I started a new application with the react-native-cli.
I want to use expo for development purpose:
Running on devices through Expo.
Publishing through Expo.
Is such a thing possible?
Copy pasting your 2 questions in Google and the first result...
1.
https://docs.expo.io/versions/latest/guides/testing-on-devices/
2.
https://docs.expo.io/versions/latest/workflow/publishing/
any questions left???
No, its not possible, in the docs its explicitly mentioned you can choose either the expo path or bare react native path. And if you choose expo you can eject from it to pure react native but cant go vice versa because the expo wrapper cant be implemented on the bare app.
so you have to again build an app with expo-cli to use expo publishing facilities etc.
but if you want to use expo modules in bare react native app you can do by using react-native-unimodules .
rn-unimodules
hope it helps. feel free for doubts
If anyone is ever looking for the answer it is stated here:
https://docs.expo.io/versions/v35.0.0/introduction/managed-vs-bare/#bare-workflow
It clearly states that in "bare" workflow you cant use the build services of Expo.

How do I know if a third party library will work with Expo?

Expo is great. One of it's goals is to use only javascript to write React Native apps.
How do you determine if a third party React Native library will work in the Expo development environment?
The simplest approach is to look at the install instructions of the library.
If react-native link is mentioned then it won't work with Expo.
You can run any library by Detaching to ExpoKit but you will lose some of the benefits of using Expo in the first place.