Add expo to my react-native app already exists - react-native

I am working on a project already exists native base and I want to add expo to easily test my application.

The easiest way to do this is to make a new Expo project and copy over all the JavaScript from your existing project.
There isn't a way to react-native link expo or anything like that right now. There might be in the future but even then that wouldn't enable the easy sharing that you want. To get that you need to just use the binary code included with Expo (which can do most things you want to do).
Here is more info: https://docs.expo.io/versions/latest/introduction/faq.html#how-do-i-get-my-existing-react-native-project-running-with-expo

Expo can now be added to an existing project, run the following command for automatic installation:
npx install-expo-modules#latest
If the command fails, you can refer to the docs for manual installation instructions.

Related

Can i use "react-native-health" for the expo

I want to use "react-native-health" for the expo and the platform is IOS, and I want to install it on my iPhone is this possible with the expo?
With expo-dev-client you can use react-native-health and continue you to use an expo managed project.
Link: https://docs.expo.dev/development/getting-started/
Once you install react-native-health, you won't be able to use Expo Go anymore since Expo Go will not be able to run react-native-health. In order to test your app you will have to create a custom dev build, as shown in the link above. Once you have done so, you'll be able to easily test and iterate your app just like you would have with Expo Go.

What can I look for to check if a project is set up as a "managed Expo project"

I'm trying to understand React Native development environment. I'm using Visual Code in Windows.
I've got a simple project A that I set up using the Expo tutorial as a "Managed Expo Project". Just a simple page and I'm trying to use a checkbox component.
I've got another inherited React Native project B, and I want to find out if it's a "Managed Expo Project" or a "Bare React native" project. It does include Expo, but I have read that even a Bare React Native Project can include expo.
So: Is there a setting on a line in a config file somewhere that makes it one or the other? ie Does the existence of "expo": "~40.0.0", in dependencies in package.json define it?
(I came to this point because I'm trying to use CheckBox from "#react-native-community/checkbox". Project B builds fine when using this, but my simple project A does not. I see on Expo website that this does not work with Expo, and that we are supposed to use a component Expo-Checkbox instead. SO I wanted to confirm the 2 projects are both expo-managed.)
Thank you.
Run expo diagnostics in your project and it will tell you what workflow you're using. The heuristics used to determine your project type are:
do you have an ios directory or android directory?
do you have react-native-unimodules in your package.json?
Usually people end up with a bare workflow project by accident when they eject and then don't properly revert their project once they decide to abort.
npm install expo-env-info
npm expo-env-info
Outputs
...
Expo Workflow: bare

I need help uploading something to expo

I want to create my own podcast app.
I found this pre-written code online (github.com/diego3g/rocketcasts) and want to tweak it in order to create my own app.
How do I upload this code into expo?
Unfortunately that React-Native app was not built using Expo. You can tell because it has ios and android folders in its root directory.
Digging deeper you can see that it uses react-native-config as a dependency. This dependency requires access to native code, which Expo does not allow. You would have to go through and remove any dependency that requires native code if you wish to use Expo. This may remove functionality and could take some time to resolve issues.
Also this application was built using react-native: 0.47.2. Currently the most recent version of react-native is 0.57.8 with 0.58.0 just around the corner. That is quite a jump to make if you plan on upgrading the react-native version. Upgrading RN is not as simple as just changing a version code.
Similarly the repos last commit was over a year ago. That means that the majority of dependencies will be out of date and will need upgraded. Again, some dependencies aren’t a simple upgrade you would need to check every single one to make sure that it doesn’t cause unforeseen problems. You would also need to check their compatibility with Expo.
Personally I wouldn’t copy the project. I would look at how they have implemented the functionality and then in a new react-native project I would re-implement the functionality. That way all dependencies would be up to date and you would know that it would work.
Going down the path of editing an existing project like this one may be quite a challenge.
Either way good luck.
You can find more information about Expo here https://docs.expo.io/
And you can find a good explanation of the differences between Expo and react-native init here What is the difference between Expo and React Native?
The standard way to tweak an existing GitHub repository you don't own is to:
fork the repo (that is a GitHub operation, creating a copy of the repo in your account)
clone it and modify it: you can then push back to your GitHub fork.

using fabric beta testing with react-native expo project

Is there a way I can use Fabric beta testing with react-native expo project ?
I searched all over the internet but didn't find an example of this.
Edit 1: The project has been already created using CRNA command.
PS: I know I can detach from expo then build each project with fabric separately, but detaching process is tedious.
You need to detach your app, once detached you can follow the crashlytics iOS guide with Objective-C, with a difference in the API key step, use the Info.list file inside the Supporting group, just make sure to delete the old Fabric keys already added inside that file.
After that you can use the beta like a normal iOS app, hope this helps you

Recomended way to create React-Native-for-Web app?

I want to create a React web app that may or may not become a native app, and for that I'd like to develop it using React Native for Web. However, I'm not sure what is the best course of action, to keep the native targets a realistic possibility:
Do I use react-native init, then add the web aspects on top of it?
Do I use create-react-native-app and do the same?
Do I use create a webpack based react-native-for-web app and then add ios or android specific features?
Another option is to use create-react-native-web-app
https://www.npmjs.com/package/create-react-native-web-app
$ npm i -g create-react-native-web-app
$ create-react-native-web-app myApp
$ cd myApp
$ npm run web
I've been researching this process for the past week. Here are some options I found that might work for you.
Option 1
There is the react-native-web module which basically allows you to simply code in react-native with web polyfills.
Repo here: https://github.com/necolas/react-native-web
Option 2
There's also a template called re-start you can use which can set you up with a startpoint that will allow you to code in react-native and build Android, iOS, Web, Windows[UWP] and Electron[macOS, Ubuntu, Windows] apps.
Repo here: https://github.com/react-everywhere/re-start
Option 3
If you don't want to use the polyfill option, I actually am working on a build that just simply merges react-native and create-react-app but you have to separate the logic between the 2 platforms yourself.
Repo here: https://github.com/ReyHaynes/react-redux-web-native