Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react native link using expo?

How can I use react-native link or How can I link a third party library manually in IOS and Android using exponent.

I was trying to link react-native-image-crop-picker but unable to use in exponent.

like image 374
Ankush Rishi Avatar asked Jul 07 '17 18:07

Ankush Rishi


People also ask

Can I use React Native link with Expo?

Expo CLI is a safe bet for a new React Native developer, since it has set of tools built around React Native, so that you only need a recent version of Node. js and a phone or emulator to get started within minutes.

How do you link with Expo?

Linking module Published app in Expo Go: exp://u.expo.dev/[project-id]?channel-name=[channel-name]&runtime-version=[runtime-version] Published app in standalone: myapp:// Development in Expo Go: exp://127.0.0.1:19000. You can also change the returned url by passing optional parameters into Linking.

Can I use Expo API in React Native?

Note: this post was originally published on February 28, 2019, and subsequently updated on March 14, 2019 to reflect improvements to the workflow. Starting today, you can use as little or as much of the Expo SDK as you like in any React Native app.


2 Answers

You can't. It states this very clearly in the docs:

But no native modules…

The most limiting thing about Expo is that you can’t add in your own native modules without detaching and using ExpoKit. Continue reading the next question for a full explanation.

If you want to use anything that requires react-native link, then you need to detach your project and then develop it with or without ExpoKit. You will lose certain features and integrations (off the top of my head, I think Push Notifications via Expo is one of them) when doing so, but that is the trade-off Expo provides as an all-in-one package. When detaching, you lose those features.

like image 142
Michael Cheng Avatar answered Sep 22 '22 03:09

Michael Cheng


The answer by Michael is correct, but what if I say there is a way in which you can add a custom native module in expo. You can do things like react-native link, and won't lose anything provided by expo like push notification, over-the-air (OTA) updates provided by expo.

Go through this detailed blog which shows how exactly you can do that. https://codersera.com/blog/running-expo-react-native-together/

Note: They have created a starter kit as well, so you don't need to go through the pain of doing the entire setup by yourself. But even if you have the ongoing project, moving to the starter kit is more of a copy and paste.

Let me know if you have any questions!

like image 27
Prashant Singh Avatar answered Sep 23 '22 03:09

Prashant Singh