CRNA eject vs Expo Detach pros and cons?

#1

So I might need to eject/detach my project soon since my project now requires downloading files/images and some other features that requires libraries that need to be linked (react-native link).
I created the project with CRNA, and have come to understand that I have 2 options of going about this (eject or detach).

Though I’m abit unsure about the pros and cons of using CRNA eject or Expo detach. What I understand so far is that CRNA eject gives you the option to either use ExpoKit or just use plain react native, while Expo detach ensure ur project is attached with ExpoKit to make life easier in case ur using any Expo APIs in ur project so far.

FIRST DUMB QUESTION:
when the docs says Expo APIs, what is this referring to? is it expo XDE and commands that requires ‘exp’ when run in the terminal? or does it include things like expo BarcodeScanner?

if so I might need to use Expo detach, since I’m very reliant upon the exp build:android and build:ios command and a noob with creating and publishing actual apps.

SECOND QUESTION:
I understand that ExpoKit manages IOS dependencies using CocoaPods. which means if I was to incorporate libraries that requires react-native link that doesn’t support cocoapods, I have to make the dependencies changes in Xcode myself. Which being the noob that I am might be abit challenging.

So, if I decided to use detach, is there any more downsides of similar nature I should be aware of?

THIRD (possibly dumbest) QUESTION:
after detach/eject, if I’m only ever going to use external lib with react-native link should I have to worry about the level of maintenance required in Xcode/Android studio environment or I can just continue my project as I have been doing so far and simply use VSCode to edit both ios and android folder when necessary? i.e. adding stuff to manifest and info.plist?

Please keep in mind when answering this that I’m very new to programming world so please don’t make assumptions, consider me a non-programmer :slight_smile:

Thanks in advance! :smiley:

#2

when the docs says Expo APIs, what is this referring to?

Everything under the “SDK API Reference” header in the docs:
https://docs.expo.io/versions/latest/sdk/

So, if I decided to use detach, is there any more downsides of similar nature I should be aware of?

You’ll have to use Cocoapods no matter what, so this shouldn’t be a factor in whether to use raw React Native vs. expokit.

after detach/eject, if I’m only ever going to use external lib with react-native link should I have to worry about the level of maintenance required in Xcode/Android studio environment or I can just continue my project as I have been doing so far and simply use VSCode to edit both ios and android folder when necessary?

Yes, you’ll have to worry about maintaining the native project. In the best case, you’ll only have to run react-native link and then build the native project, but if anything goes wrong you’ll have to get familiar with the native code.

In summary, anytime you start modifying native code you’ll have to get comfortable with Xcode/Android Studio. If you’re really worried about that I’d encourage you to try building as much as you can without detaching. Hope that all makes sense!

#3

@jesse thanks for the prompt reply and thorough explanation! :smiley:
So that means, without ExpoKit, if my project is importing anything from ‘expo’ i.e. BarcodeScanner, it won’t work?
But then again I have the option of using third party libraries that requires ‘react-native link’…

And yes that’s what I’m doing right now, I’m postponing detach process until the very last iteration of my project to see if further non-native solutions come into development so that I can just use those.

So far my only reasons for needing to eject/detach is the fact that I’ll need google-analytics-bridge, backhandler in RN has a problem and I need to edit Android folder, and I’m having trouble with Expo Camera/BarcodeScanner possibly not terminating one of the async operations and cause the app to freeze and crash after accessing scanner multiple times(which I already +1’d on a post facing same problem as me). All of which might come to be fixed before my project ends. :slight_smile:

Thanks again for the help, really appreciate it :slight_smile:

1 Like
#4

So that means, without ExpoKit, if my project is importing anything from ‘expo’ i.e. BarcodeScanner, it won’t work?

Correct, BarcodeScanner and all the other APIs listed under https://docs.expo.io/versions/latest/sdk/ require ExpoKit.

But then again I have the option of using third party libraries that requires ‘react-native link’…

You can use react-native link with ExpoKit

1 Like
closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.