realm: using in CRNA app - react-native

I want to use Realm in CRNA (Create React Native App) app. After installing this package, I have to use this command to link it to the ReactNative.
react-native link realm
But after running it, I get this error:
"react-native link can not be used in Create React Native App projects. If you need to include a library that relies on custom native code, you might have to eject first."
Is there any way to use Realm in CRNA app without ejecting?
I noticed this link but has it ever been changed?

Related

Using Native Module in an Expo Project in a 'Managed apps'?

So the post is with reference to article
https://blog.expo.io/you-can-now-use-expo-apis-in-any-react-native-app-7c3a93041331
The 'Managed apps' here refers to an app created using expo-cli. I was wondering if one could implement one's own native module in a 'Managed App';
The app does run with react-native run-ios or react-native run-android, so do we get all the functionality of a normal react-native app?
The title of the article that you shared says:
You can now use Expo APIs in any React Native app
Which means that you can use the Expo APIs, but in 'Bare' workflow.
It doesn't say that you can work with native modules in 'Managed' workflow.
Bare workflow means that you cannot use the following Expo services:
The build service (expo build:ios; expo build:android)
Expo publish
over-the-air (OTA) updates
Push notifications

React native difference in react native project directry structure

While creating an app in react native, I didn't get sub directories like android,or IOS. I Used create-react-native-app command.
New version of CRNA integrates Expo Toolkit, and android and ios folders are hidden. If you want to separate these folders, you must detach expo from react native app.
npm run reject
You can read more detail at CRNA's github

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

How to use expo kit in react native init?

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