How to use expo kit in react native init? - react-native

I have used create react native app tool to create initial setup of the my app. With CRNA i used Expokit also. After ejecting CRNA into react-native init setup i couldn't use expo camera features. I'm getting below error while launching app in simulator ("undefined is not an object(evaluating 'ExponentConstants.linkingUri)"). How resolve and use expokit after the eject the application?

Now you can use react-native-unimodules
If you create a React Native project through react-native init or with
another tool like ignite-cli, then you’ll need to add the
react-native-unimodules package to your project and configure it
first: follow the instructions in the README.
See detail at expo blog.

After you eject from create-react-native-app you need to use Git or another version control tool to go back. You can create a new project with create-react-native-app, copy over your JS code, make sure it works, and then eject and this time choose the ExpoKit choice.

It's not possible yet, according with this answer in the Expo Forumn: https://forums.expo.io/t/react-native-init-expo-sdk/1903/2

Related

Can I use Expo to run a react-native project created by RN CLI?

I was wondering if I could use Expo to run the react-native project that I created using the npx react-native init command, since it generates a better structure for real-world applications.
The reason I want to do this is to avoid the countless erros that I had while running and debugging the app.
You can't do that..
React native and expo are different.
You can run expo projects on react native by detaching them. Expo has limitations.
You can not run react native projects on expo, i.e projects made by react native init/npx can't run on expo
You can use a package made available by the expo
react-native-unimodules
for any React Native project using some resources made available by the expo.
react-native-unimodules

Creating new project ReactNative

On the official website we can read how to create new project:
create-react-native-app AwesomeProject
but on tutorials I always see:
react-native init AwesomeProject
What is the correct? What is the difference between them
One uses Expo and the other does not. With create-react-native-app you use Expo and native code is totally transparent to you.
With the typical react-native init, you get all the code and you can modify native code if you want (or write custom native modules).
You can find everything documented here: https://facebook.github.io/react-native/docs/getting-started.html
First tab, Quick start is about create-react-native-app, second tab Building Projects with Native Code is about react-native init.
Probably in most tutorials you find the react-native init option because that option is there from the very beginning while create-react-native-app is newer new utility.
Recommendation:
If you know you will need to modify native code, use react-native init. If not, you can go with create-react-native-app
Even if you go with create-react-native-app, if at some point your needs change, you can eject
Referencing EvanBacon's answer, react native init creates a purely react native app, whereas Facebook's create-react-native-app makes a project "bootstrapped with expo."

How to transfer EXPO project to React Native project?

I build an app with Expo tool .. but now I what to move to react native without expo .. I tried to just create a new project in react native and then transfer the code that I had written and install components that I had used in my app .
the app with Expo work as expected put with moved to react native without Expo works as unexpected and crashes.
you don't need to transfer the code like that, the expo provides us to detach our code from expo to without expo react-native projects.
please refer to this link expokit eject
if you want to use expo API in your project then you can detach your app using detach-with-expokit.
use expo eject to add ExpoKit (choose the "ExpoKit" option).

differences between create-react-native-app and exp init

I found that create-react-native-app is based on expo. but when using exp-cli, it is also based on Expo.
what are differences between create-react-native-app and exp init ?
Updated answer:
create-react-native-app was replaced by expo-cli.
https://docs.expo.io/workflow/glossary-of-terms/#create-react-native-app
Answer to this question is well documented in expo documentation
Expo & "Create React Native App"
Create React Native App lets you build a React Native app without any
build configuration. This may sound familiar to you because Expo does
this as well -- when you create a project with XDE or exp you don't
have to deal with Xcode or Android Studio configuration files, it just
works. This guide is intended to outline some of the key differences
between Expo and CRNA (create-react-native-app).
CRNA does not require you to have an Expo account
You can run create-react-native-app YourAppName and off you go. So what does not
having an account mean, and what would signing up and using XDE/exp
get you -- why do we require it with Expo? Having an Expo account
allows you to do the following:
Publish your project to a permanent URL, eg:https://expo.io/#community/reactconf2017.See Publishing on Expo for more information.
Build binaries for app / play store distribution. To do this with CRNA without using Expo,
you would need to run eject.
There are advantages and disadvantages to either:
React Native app advantage:
You can add native modules written in Java/Objective-C
React Native app disadvantage:
Needs Android Studio and XCode to run the projects
Expo advantages:
Setting up a project is easy and can be done in minutes
Expo can build .apk and .ipa files
You do not need simulator to run your app.
Expo disadvantages:
You can't add native modules.
Your final app will bigger with expo init than with react native app init.
I suggest you read this:
https://docs.expo.io/versions/latest/introduction/why-not-expo

Can we user razorpay plugin with reactnative and expo

In plugin they mentioned that the razorpay is not going to work with expo. i want to acces razorpay plugin in my react native app. is there any way..? i am using expo. please help me
if the react native library you want requires a linking step, then you can detach and use ExpoKit directly.
https://docs.expo.io/versions/latest/guides/detach.html
EAS builds officially released in Expo SDK 42 makes it possible to run native modules on expo projects.
In order to make sure Razorpay wrapper works correctly:
Create a dev build of your expo app by following the instructions mentioned here.
run your project by running the following command
For ios
expo run:ios
For android
expo run:android