Overview
The “react-native-jsi-template” is a library that serves as an example for building JavaScript Interface (JSI) modules from scratch in React Native. It provides support for building and integrating these modules within React Native projects. This library was created as a complementary resource for the developer’s blog.
Features
- Platform Agnostic: The library contains code that is compatible with both Android and iOS platforms.
- Platform Specific: The library provides platform-specific code for Android (android/cpp-adapter.cpp) and iOS (ios/SimpleJsi.mm).
- Basic Usage Example: The library includes an example app that demonstrates the basic usage of the JSI modules.
Installation
To install the “react-native-jsi-template” library, follow these steps:
Install the required dependencies:
- For Android, make sure you have the Android NDK and CMake installed on your machine.
- For iOS, navigate to the “/ios” folder and run
pod install
to install the necessary dependencies.
Include the library in your React Native project:
- Copy the relevant code files from the library into your project’s source code directory.
Build the library:
- For Android, use the Android NDK and CMake to build the library.
- For iOS, use Xcode to build the library.
Summary
The “react-native-jsi-template” library provides a helpful example for developers who want to build their own JavaScript Interface (JSI) modules in React Native. It offers platform agnostic code, as well as platform-specific code for Android and iOS. With the included example app and installation guide, developers can quickly get started with integrating JSI modules into their React Native projects.