Docs Menu

Docs HomeRealm

Install Realm for React Native

On this page

  • Prerequisites
  • Using Realm with Expo
  • Installation
  • Create a React Native Project
  • Install Realm with npm
  • Enable Hermes (optional)
  • Resolve CocoaPods Dependencies
  • Enable TypeScript (optional)
  • Install the @realm/react Library
  • Run the App
  • Create a React Native Project
  • Install Realm Using NPM
  • Link the Realm Native Module
  • Confirm the Link Step (Android)
  • Enable TypeScript (optional)
  • Run the App
  • Import Realm

The Realm React Native SDK enables development of React Native applications using the JavaScript and TypeScript languages. React Native enables you to build cross-platform iOS and Android apps with a single codebase using the React framework.

Before getting started, ensure your development environment meets the following prerequisites. These are required for the latest version of the Realm React Native SDK:

  • Follow the official React Native CLI Quickstart instructions
    to set up your environment.
  • React Native v0.71.4 or later. Check out the compatibility chart
    to determine which version of React Native is compatible with specific Realm React Native SDK versions.

Note

Realm JS v10.6.0 and Later Support Mac Catalyst

Expo supports Realm with the Expo SDK v48.

To use Realm with Expo, upgrade to Expo SDK v48. Check out the compatibility chart to determine which version of the Expo SDK is compatible with specific Realm React Native SDK versions.

Select the tab below that corresponds to your React Native version. Follow the steps to create a React Native project and add the Realm React Native SDK to it.

Add the following line to the top of your source files where you want to use Realm:

import Realm from "realm";
←  Realm - React Native SDKQuick Start - React Native SDK →
Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.