Start your React Native Expo project using a pre-built template
In this section, you will learn how to get started with React Native using an Expo template and how to connect it to Back4App in 4 easy steps.
To complete this tutorial, you will need:
- A Backend Back4App App.
To get the template project, download and unzip the source code at our GitHub repository into your machine or clone the project with the git command line.
Run the following command to download and extract the template using CURL:
OR
Run the following command to clone the template using GIT:
- Make sure that you have installed npm or yarn in your system.
2. On your terminal, run cd react-native-template-master and open the project's root directory.
3. Run npm install to install dependencies.
In this tutorial, we are using npm to manage dependencies but you are free to use yarn instead.
To allow the App to securely connect to Back4App servers, you must provide Parse JavaScript SDK with the app’s credentials.
- Locate your App ID and Javascript Key credentials by navigating to your app Dashboard > App Settings > Security & Keys.
On the project’s root directory, open the file at: app/(tabs)/index.tsx.
The file should look like this:
Copy and paste your App Id and Javascript Key on it.
Inside the App.js of your template project, there is a function that creates a Person object and another for fetching People of your App to your Back4App Database.
To run and test your App connection:
- Open your project’s terminal.
- Runnpm run android or npm run ios or npm run start to open the application on your target platform
At this point, you have learned how to get up and run a React Native application connected to Back4app.