Every app is made up of some combination of React Native, Expo SDK, and third party libraries. It's important to understand how to use the libraries from each of these sources, and how to determine whether a third-party library will work in your project or not.
React Native provides a set of built-in primitives that most developers will need in their app. These include components such as ActivityIndicator, TextInput, Text, ScrollView, and View. These are listed in the Core Components and APIs page of the React Native documentation. We also list the React Native Core Components and APIs in the API Reference section of the Expo documentation, so you can quickly see the documentation relevant to the SDK version that your app uses in the same place as you would find it for Expo SDK libraries. You can see the React Native version that corresponds to your Expo SDK version in the table on the API Reference index.
The react-native core library is installed automatically in every Expo app. To use a React Native library in your project, import it from the react-native package in your code:
The Expo SDK picks up where the React Native core libraries end - it provides access to a lot of useful device and system functionality like audio, barcode scanning, camera, calendar, contacts, video, and so on. It also adds other powerful libraries like over-the-air updates, maps, OAuth authentication tools, and more. For details on how we decide what goes into the Expo SDK, read here.
To use a library from the Expo SDK, find the one you are looking for in the API Reference or through the documentation Search bar.
At the top of the page you will see a description of the library and a platform compatibility table. It tells you which platforms and environments the library is compatible with. It looks like this:
After the platform compatibility table, there will be an Installation section, with instructions that look like this:
expo install expo-device
Next, under the API section the reference page will tell you how to import the library in your code:
This section also lists all of the types, functions, and classes available. If you use TypeScript, you can see this information in your TypeScript-compatible code editor (such as Visual Studio Code) with autocompletion.
React Native Directory is a searchable database of libraries built specifically for React Native. If the library that you are looking for is not provided by React Native or Expo then this is the best place to look first when trying to find a library for your app.
Determining Third-Party Library Compatibility
Check React Native Directory: find the library on the website (if it's there) and verify that it has a "✔️ Expo client" tag. You can also enable the filter by Expo client option to only show libraries that are compatible with the Expo managed workflow.
Not listed on the directory? find the project on GitHub, an easy way to do this is with npx npm-home --github <package-name>. For example, to open the GitHub page for react-native-localize you would run:
npx npm-home --github react-native-localize
Now check the following:
Does it include an ios and/or android directory?
Does the README mention linking?
Is it built specifically for Node.js, the web, electron, or another platform?
If you answered yes to either of these questions and the library is not part of the Expo SDK, this library may not be supported in the managed workflow. You can go ahead and try it in a new project to be sure! Run expo init and add the library to the new project and try to use it. This is a great way to experiment with a library before including it in your project in all circumstances.
If the library is not compatible with the managed workflow and you need it to build your app, you may want to eject to the bare workflow.
💡 We recommend always using expo install instead of npm install or yarn add directly because it allows expo-cli to pick a compatible version of a library when possible and also warn you about known incompatibilities.
Once you have determined if the library is compatible, use expo-cli to install the package:
expo install @react-navigation/native
Be sure to follow the project website or README for any additional configuration and usage instructions. You can get to the README quickly using this command: