react native link using expo?

心不动则不痛 提交于 2019-11-30 01:23:23

问题


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.


回答1:


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.




回答2:


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!



来源:https://stackoverflow.com/questions/44977693/react-native-link-using-expo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!