Is it possible to get rid of expo completely - reactjs

I'm using react native expo 47 and I wanted to eject from expo to have native modules for ios and android to use my native code or 3rd libraries. But on 47 sdk expo there is no eject. Instead it I could make prebuild which generated for me native folders for ios and android. But when i want to use any library which use native code i have exception that its not defied sdk in gradle etc. How to get rid of expo completely and use react native cli? There is way to migrate from expo to cli without any expo requirements?
I remember that in older expo sdk it was eject prcess which allow you to do whatever you want in project. I want to achieve the same solution.
I want to migrate from expo to react native cli with no expo dependencies and rules, to work with native codes.

Related

Facing problem in using tensorflow (js) in react native cli (not in expo cli)

When ever i install the dependencies of tensorflow in react native cli and do number of changes in android files even then the app doesn't run due to some issue in #unimodules/react-native-adapter . Does anyone know the right way to work with tensorflow in react native cli (not in expo cli)

How do I run expo apps on android studio without ejecting?

I followed expo documentation, but I can't figure out how to run it on an emulator without ejecting. I've heard ejecting is risky and I can't keep making changes to the app if I eject. When I click run, it gives me Error: Module not specified, but there is no module from the dropdown list.
You can run your app on android emulator with expo app on this emulator or make expo build:android and select apk option. Then just download and install apk on any device. You don't able to run expo app in android studio like native app without ejecting. I recommend you not to use Expo at all and have a look on fast line, pure react native app is more flexible and with fast line has almost the same benefits like expo app. Development without expo is not a big deal.

React native EXPO installation (npm start)

I created my app in react native using Expo but when i run the npm start command its showing me this:
running metro bundler on port 8081
and then
loading dependency graph, done
and never end. what to do?
Here is the complete console output.
First of all if you have a bundler like the one that you have used then it would suggest that you have used react-native init to create you application, instead of expo.
Expo bunders look like this:
If you have created a react-native init and as it suggests in your screenshot that you are building the app on a Windows machine, that means you will be developing on Android.
The instructions for using Android and running react-native are quite long and complicated, they can be found here. For the sake of brevity I am not going to repeat them here asyou can just follow this link. Make sure to choose Building Projects with Native Code -> Development OS: Windows -> Target OS: Android to find the instructions that are pertinent to your situation.
https://facebook.github.io/react-native/docs/getting-started.html
If you are planning on developing on an emulator then you will need to make sure that you have one installed (the link above has all the info that you need). Also you need to make sure that you launch your emulator before running react-native run-android if you do that then it should load on to the emulator and you should be able to see what you are developing on.
If you want to run on your own Android device then you should follow the instructions on this page https://facebook.github.io/react-native/docs/running-on-device (again choosing the options for your situation).
Expo
If this feels like too much effort, you can always try Expo. It doesn't require you to be able to deal with native code. And depending on your use case can be a better option than creating a project with react-native init, plus you can always eject from the expo project and turn it in to a full fledged react-native app.
You install the expo-cli with
npm install -g expo-cli
Then download the expo app from the App Store or the Google Play Store (depending on the mobile that you are using).
Then you can use
expo init
to create your application
Check out the expo documentation for more information https://docs.expo.io/versions/v32.0.0/workflow/up-and-running
Well, Nice question, First of all, I totally understand what's exactly your problem is, let me give you a solution in a very appropriate way.
Basically, there is two way to install and setup React Native Project on your mac and windows machines
1st React Native (native) Method: (That's basically you're using right know
Note: If you're using Apple product - Like MacBook then you can do IOS and Android both platform by using this method, if you're using Windows or Linux you can only do this part for Android platforms
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
Installing the React Native Cli
npm install -g react-native-cli
If you get an error like Cannot find module 'npmlog', try installing npm directly: curl -0 -L https://npmjs.org/install.sh | sudo sh.
(Only for mac)
Install the Xcode from Appstore (Only for Mac user/macos users)
otherwise
download and install the Android Studio (Stable version) from the official website of Android studio
Setup Xcode (Simulator) or Setup Android Studio for Android devices use (emulator)
by learn and guide from this link here
Note: Basically in your scenario, I'm pretty sure you didn't set up your emulator for android and simulator for IOS that's why you didn't see anything after
2nd React Native with Expo Method: that's you're not using a loading dependency graph
Use
For Android
react-native run-android
For IOS
react-native run-ios
2nd React Native without Expo (that's not your case):
In this method, we have to follow these simple steps
Download Nodejs from Offical website link here
installing expo cli
npm install -g expo-cli
expo init yourprojectname
cd yourprojectname
npm start
Note: Simulators and emulators way same for both

Remove expo from react native

I've had so many troubles with the tool, I seriously have been debugging expo morethan the app itself.
How might I remove expo completely from CRNA? I would like to use CRNA and it's debugging tools without expo
You can do it by ejecting your app running npm run eject
Then, if you have any reference to expo just remove all of them.
your app modules before being ejected looks like this below:
When you run npm run eject it will ask some questions like:
be sure to select React Native: I'd like a regular react Native project
And your folders will now look like this (no expo):
Just be careful because ejecting is a permanent process, you should make a backup of your files.
Once you eject from Expo, though, and if you're using a Windows computer, you'll only be able to develop for Android, I believe. You'll still need a Mac to work in React Native without Expo. I'm a beginner but just wanted to highlight this difficulty faced by Windows users when ejecting from Expo.

React Native installation: Diff between create-react-native-app and react-native-cli

I am a newbie to React Native and I have just started leaning it. During its installation, came across the following commands
npm install -g create-react-native-app
npm install -g react-native-cli
It says that the first one is the easiest way to start building a new React Native application, where as the second is from older mode of installation. How these two ways differ from each other? Which one should be selected especially as a beginner like me to learn React Native? Which one is the best way to install React Native?
The create-react-native-app package is a community-driven package that gives you a basic template for React Native so you can start right away instead of having to set up Babel, Expo (which allows for cross-platform development), etc. It's a great way to start with React Native without having to set up any boilerplate or have an Apple machine for iOS projects. It's a CLI that generates a project for you to start without any hassle.
But create-react-native-app has its limitations. The tradeoff is out-of-box ease for less customizability. That's where react-native-cli comes in. This is the CLI that is used to create new pure React Native projects, run them, etc. This does not include Expo which does not allow for the ease with CRNA nor cross-platform development (you'll have to use an Apple machine for iOS). But with a pure React Native project, you can add native libraries and APIs for your project, which is not possible with CRNA. You can achieve a pure React Native project from a CRNA project by ejecting down the line.
I would suggest CRNA as a starting point because it allows you to use Expo to demo your apps on devices quickly and has support for both Android & iOS, regardless if you have Xcode or not -- without any configuration hassle. But it comes with limitations which you can alleviate with ejecting (but will lose other capabilities).

Resources