Use libraries (2024)

Learn how to use libraries based on React Native, Expo SDK and third-party in your project.

Every app is inevitably going to use a third-party library, so it's important to understand how to determine whether a library is compatible with your project.

React Native core libraries

React Native provides a set of built-in primitives that most developers will need in their apps. These include components such as <ActivityIndicator>, <TextInput>, <Text>, <ScrollView>, and <View>. These are listed at Core Components and APIs in React Native documentation. You can also view the React Native version that corresponds to your Expo SDK version.

To use a React Native component or API in your project, import it from the react-native package in your code:

Example

import { Text, View } from 'react-native';export default function App() { return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <Text>Hello, world!</Text> </View> );}

Expo SDK libraries

The Expo SDK picks up where the React Native core libraries end. It provides access to a lot of device and system functionality such as audio, barcode scanning, camera, calendar, contacts, video, and so on. It also adds other powerful libraries like updates, maps, OAuth authentication tools, and more. For more information, see how we decide what goes into the Expo SDK.

To use a library from the Expo SDK, find the one you are looking for in the API reference or use the documentation search.

Are you using this library in a bare React Native app?

If you initialized your app using npx react-native init and you don't have the expo package installed in it yet, see the installing Expo modules guide for more information.

You will see the platform compatibility tags at the top of each API reference. It tells you which platforms and environments the library is compatible with. For example, the platform tags for the expo-device library look like the following:

After the platform compatibility table, there is a library's description and a section with instructions on installing the library. For example:

Terminal

-

npx expo install expo-device

The npx expo install command picks a library version compatible with your project and then uses your JavaScript package manager (such as npm) to install it.

Next, a typical API reference includes:

  • Config plugin usage information if the library requires a config plugin.
  • A code example that shows how to use the library.
  • API section that lists how to import the library, followed by a list of hooks, props, types, methods, and classes that the library provides.

Note: If you use TypeScript, you can see the information included in the API section in your TypeScript-compatible code editor (such as VS Code) with auto-completion.

Third-party libraries

Finding a third-party library

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 the Expo SDK then this is the best place to look first when trying to find a library for your app.

After the React Native Directory, the npm registry is the next best place. The npm registry is the definitive source for JavaScript libraries, but the libraries that it lists may not all be compatible with React Native. React Native is one of many JavaScript programming environments, including Node.js, web browsers, Electron, and more, and npm includes libraries that work for all of these environments. Any library that is compatible with React Native is compatible with the Expo project when you create a development build. However, it may not be compatible with the Expo Go app.

Determining third-party library compatibility

Use Expo development builds for building production-quality apps. It includes all of the native code that your project needs to run. This is a great way to test your app before you publish it to the App Store or Google Play. You can also include libraries that require native projects (android and ios directories) configuration.

The Expo Go app is an optional stepping stone towards development builds. You can use it to quickly test your app while you are developing it, but it does not include all of the native code required to support every library. You can check React Native Directory to find a library compatible with Expo Go by visiting the website and verifying that it has a "✔️ Expo Go" tag. You can also enable the filter by Expo Go.

To determine if a new dependency changes native project directories, you can check the following:

  • Does the library includes android or ios directories?
  • Does the library's README mention linking?
  • Does the library requires you to change android/app/src/main/AndroidManifest.xml or ios/Podfile or ios/Info.plist to change the project configuration?
  • Does the library have a config plugin?

If you answered yes to any of these questions, then you should create a development build to use the library in your project.

Not listed on the directory? You can find the project on GitHub. A simple way to do this is with npx npm-home --github <package-name>. For example, to open the GitHub page for react-native-localize, run:

Terminal

-

npx npm-home --github react-native-localize

If you want some help determining library compatibility, create an issue on the React Native Directory repository and let us know. This will not just help you, it will also help other developers have an easy answer in the future!

Installing a third-party library

We recommend always using npx 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 with React Native, use Expo CLI to install the package:

Terminal

-

npx 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:

Terminal

-

npx npm-home @react-navigation/native

If the module needs additional native configuration, you can do so using config plugins. Some packages require a config plugin but they don't have one yet, you can refer to the list of out-of-tree config plugins.

Are you using this library in a bare React Native app?

If your project does not support Expo Prebuild then you won't be able to use config plugins. You can either adopt Expo Prebuild or set up and configure each library manually by following any additional setup guides from the respective module's website or README.

If the module is not supported in Expo Go, you can create a development build:

Add custom native code

Learn how to add custom native code to your Expo project.

Use libraries (2024)

FAQs

How to effectively use the library? ›

7 Steps to Effective Library Research
  1. SELECT YOUR TOPIC. ...
  2. IDENTIFY KEY WORDS THAT DESCRIBE YOUR TOPIC.
  3. Example Keywords: alcohol abuse, college students. ...
  4. FIND BACKGROUND INFORMATION.
  5. USE ONLINE CATALOG TO FIND BOOKS.
  6. USE RESEARCH DATABASES TO FIND JOURNAL ARTICLES.
  7. EVALUATE WHAT YOU FIND.
Jul 13, 2023

Do people still use libraries? ›

It found Gen Z and millennials make up the largest cohort of library users across the United States. The study found that 54% of people aged 13-40 visited physical libraries within the past year and 37% said they had used their library's digital collection.

Why you should use the library? ›

By providing free access to educational, news, and historical resources, libraries help keep the public informed with facts, rather than confused with fiction. They act as a hub of information, and their leaders, the librarians, torch bearers for facts.

Why do programmers use libraries? ›

A library is a collection of pre-written code that you can use to perform specific tasks. Libraries are often used to reduce the amount of code a programmer needs to write by providing reusable functions or classes that can be called upon as needed. All libraries are shared into two classifications.

What are the do's and don'ts in using a library? ›

Do's and Don'ts
Do'sDon'ts
Always ask for what you wantDon't write anything in library books.
Respect Library Rules and RegulationsDon't keep the books in racks after reading
Use bins
Use book markersDo not discuss inside library
12 more rows

How do you properly use a library? ›

Ideally, you will go to the computers or the card catalogs to search for the books you need, write down their numbers or authors, and then move into the sections to find the books on the shelves. Depending on the topic you need to research, you might find that different libraries might serve you better.

What are the 5 functions of a library? ›

A library's basic functions include the promotion of education, the dissemination of information and the promotion of culture. Promotion of Education: Libraries provide the means of individual self-development and facilitate all modes of education, including formal, non-formal, adult and lifelong education.

What is the main use of library? ›

Libraries acquire books along with other reading materials, organize them, preserve them and disseminate the information to the users. In this way libraries play an important role in development of the society.

What makes a good library? ›

Great Libraries Foster Communication

Innovative libraries aren't content serving as one-way conduits of information; they want to foster dialogue and exchange with their users. To that end, many libraries house community access television and radio stations, and other means of disseminating information freely.

What are library examples? ›

Library examples
  • NumPy. Primary Language: Python. Use: NumPy is a library used to make powerful arrays. ...
  • Matplotlib. Primary Language: Python. ...
  • Keras. Primary Language: Python. ...
  • Pillow. Primary Language: Python. ...
  • SFML. Primary Language: C++ ...
  • p5. Primary Language: JavaScript.
Sep 11, 2020

What are the benefits of using a library in a program? ›

Advantages of Library Files
  • Speed up software development process as you don't have to re-engineer functionality that has already been implemented by others.
  • Allows use of functionality that you may not be a specialist in.
  • More consistent user experience throughout the operating system.

What is a common library? ›

The common library is where all users and HR-ISA can share FOCUS procedures. Members in the common library can be used 'as is' or copied to your library and modified.

How can the researcher effectively use the library? ›

See this guide for more information, tutorials, & resources.
  1. UNDERSTAND THE ASSIGNMENT AND SELECT YOUR TOPIC. ...
  2. FIND BACKGROUND INFORMATION IN REFERENCE SOURCES (3rd floor) ...
  3. USE CATALOGS TO FIND BOOKS. ...
  4. USE DATABASES TO FIND PERIODICAL ARTICLES. ...
  5. FIND INTERNET RESOURCES. ...
  6. EVALUATE WHAT YOU FIND / REVIEW YOUR PROGRESS.

How to get the most out of the library? ›

8 Tips to Get the Most Out of Your Library
  1. Get to Know Your Librarian. If you spend much time at your library with your kiddos, you will probably get to know your librarians. ...
  2. Bring Your Reading List With You. ...
  3. Keep Your Materials Organized. ...
  4. Use Hoopla. ...
  5. Use Interlibrary Loan. ...
  6. Order Online. ...
  7. More Than Just Books. ...
  8. A Quiet Place.
Sep 8, 2023

How to make the maximum use of the library? ›

Explore the resources
  1. Books and eBooks. Books are definitely the first thing people associate with libraries, so of course your library will be full of books on every subject imaginable. ...
  2. Databases and Journals. ...
  3. Study spaces. ...
  4. Multimedia resources. ...
  5. Ask the librarian. ...
  6. Make a research plan. ...
  7. Take good notes. ...
  8. Use technology.

Top Articles
How much money a YouTuber with 1 million subscribers earns, according to 4 creators
I've been a landlord for years, and there are 5 questions I asked myself to decide if I was ready to invest in real estate
Uti Hvacr
Maria Dolores Franziska Kolowrat Krakowská
Identifont Upload
FFXIV Immortal Flames Hunting Log Guide
30 Insanely Useful Websites You Probably Don't Know About
Retro Ride Teardrop
Select The Best Reagents For The Reaction Below.
Ncaaf Reference
Dusk
Saw X | Rotten Tomatoes
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
Discover Westchester's Top Towns — And What Makes Them So Unique
Bowlero (BOWL) Earnings Date and Reports 2024
Midlife Crisis F95Zone
Aspen Mobile Login Help
Craigslist Missoula Atv
Loft Stores Near Me
Teacup Yorkie For Sale Up To $400 In South Carolina
Never Give Up Quotes to Keep You Going
Piri Leaked
Dr. Nicole Arcy Dvm Married To Husband
Vera Bradley Factory Outlet Sunbury Products
Is Poke Healthy? Benefits, Risks, and Tips
Wolfwalkers 123Movies
lol Did he score on me ?
Marlene2295
Elanco Rebates.com 2022
Ezstub Cross Country
Ridge Culver Wegmans Pharmacy
Craigslist Maryland Baltimore
1987 Monte Carlo Ss For Sale Craigslist
Vitals, jeden Tag besser | Vitals Nahrungsergänzungsmittel
11 Pm Pst
New Gold Lee
20+ Best Things To Do In Oceanside California
Union Corners Obgyn
Callie Gullickson Eye Patches
Craigslist Farm And Garden Reading Pa
Promo Code Blackout Bingo 2023
Jaefeetz
Watch Chainsaw Man English Sub/Dub online Free on HiAnime.to
2013 Honda Odyssey Serpentine Belt Diagram
Noga Funeral Home Obituaries
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Is Chanel West Coast Pregnant Due Date
The top 10 takeaways from the Harris-Trump presidential debate
Call2Recycle Sites At The Home Depot
Turning Obsidian into My Perfect Writing App – The Sweet Setup
Adams County 911 Live Incident
Coors Field Seats In The Shade
Latest Posts
Article information

Author: Francesca Jacobs Ret

Last Updated:

Views: 6367

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Francesca Jacobs Ret

Birthday: 1996-12-09

Address: Apt. 141 1406 Mitch Summit, New Teganshire, UT 82655-0699

Phone: +2296092334654

Job: Technology Architect

Hobby: Snowboarding, Scouting, Foreign language learning, Dowsing, Baton twirling, Sculpting, Cabaret

Introduction: My name is Francesca Jacobs Ret, I am a innocent, super, beautiful, charming, lucky, gentle, clever person who loves writing and wants to share my knowledge and understanding with you.