The Expo Modules is a popular solution for writing native modules and views in Swift and Kotlin for React Native apps. It provides a modern, consistent API across platforms with minimal boilerplate and full support for React Native's New Architecture, while maintaining backwards compatibility.
Using Expo Modules with Re.Pack requires some setup - this guide will show you how to get started with Expo Modules in your project.
Skip the "Configure Expo CLI for bundling" section, as Re.Pack handles the bundling process.
Install the Expo package in your project:
Follow these steps from the official Expo guide:
First, install the official Re.Pack Expo Modules plugin:
Then, add the plugin to your configuration file:
After completing the setup, you can start using Expo modules in your application.
For specific module installation and usage instructions, refer to the Expo documentation.
You can verify that the installation was successful by logging a value from expo-constants
.
First, install the expo-constants
package:
Then, add the following code to your index.js
file:
You should see the expoConfig
object in the console (in React Native Dev Tools).