This template provides an example for setting up a development environment for React Native Expo applications using Dev Containers. To set up the container, please follow the instructions below:
Ensure that you have the following installed on your machine:
- VS Code
- Docker Desktop
- Dev Containers extension for VS Code
- Expo Go app on your smartphone
-
Create a New Repository:
- Navigate to the original repository page on GitHub.
- Click on
Use this template
to create a new repository based on this template.
-
Clone the Project:
- Clone the newly created repository to your local machine.
- Open the cloned project in VS Code.
-
Set Up Environment Variables:
- In the
.devcontainer
directory of your project, create a.env
file. - Add the following line to the
.env
file:REACT_NATIVE_PACKAGER_HOSTNAME=192.168.xxx.xxx
- Replace192.168.xxx.xxx
with your host machine's local IP address.
- In the
-
Reopen in Container:
- Open the Command Palette in VS Code.
- Select
Dev Containers: Reopen in Container
. VS Code will then start building the container and open the project inside it.
-
Start the Expo Server:
- Once the container is running, open the terminal in VS Code.
- Run the command
npm run start
to start the Expo server. - A QR code will appear in the terminal. Scan this with the Expo Go app on your smartphone to view the application.