Can you use libraries like https://github.com/tolu360/react-native-google-places in an Expo project? I assume any npm library is ok to add, but what about libraries like this google places picker that requires post install steps to link the native projects. Are they supported with Expo?
Libraries built by Expo are all written in TypeScript and support iOS, Android, and react-native-web wherever possible.
The tradeoff is that Expo Go does not allow you to add custom native code, you can only use native modules built into the Expo SDK. There are many great libraries available outside of the Expo SDK, and you may even want to build your own native library.
1) Add package name to new packages() 2) Add dependencies to settings. gradle file and main application's gradle i.e app/gradle file. 3) sync the projects gradle because you made changes in the gradle and it's done.
Regular Expo projects are written only in JavaScript and don't support npm packages that contain Objective-C or Java. However, Expo provides an advanced SDK called ExpoKit for when you absolutely need to use custom native code. From the Expo docs:
Normally, Expo apps are written in pure JS and never “drop down” to the native iOS or Android layer. This is core to the Expo philosophy and it’s part of what makes Expo fast and powerful to use.
However, there are some cases where advanced developers need native capabilities outside of what Expo offers out-of-the-box. The most common situation is when a project requires a specific Native Module which is not supported by React Native Core or the Expo SDK.
You could "detach" your Expo project to create Xcode and Android Studio projects that contain ExpoKit. Then you would add custom Objective-C or Java the same way as with any other Xcode or Android Studio project.
However, the Expo docs also warn about some of the downsides of writing custom native code; many features often can be implemented well in JS, allowing you to retain all of the benefits of a standard Expo project.
Warning: We discourage most of our developers from taking this route, as we believe almost everything you need to do is better accomplished in a cross-platform way with JS.
Writing in JS enables you to best take advantage of over-the-air code deployment and benefit from ongoing updates and support from Expo. You should only do this if you have a particular demand from native code which Expo won’t do a good job supporting, such as (for example) specialized CPU-intensive video processing that must happen locally on the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With