Skip to main content

New Project

Let's start by creating a new React Native project.

For this course, we'll be using plain React Native, and there will be no option for using Expo. This is to give you an idea of what's it's like to build mobile applications without the help of the Expo managed workflow. Even if you choose to build your project in Expo, you may end up ejecting and having to manage the builds yourself (e.g. if you wanted to support in-app-purchases to your app).

This means that you will be building the actual native app(s) on your device. If you didn't previously, you will now have to set up your local environment. Check out the React Native CLI Quickstart page in the React Native docs and ensure you have followed the setup instructions up to (but not including) "Creating a new application".

Creating a new application#

To create a new React Native project, open your terminal and run:

npx react-native init MoodTracker --template react-native-template-typescript

This will create a new react native project called "MoodTracker" using a react native TypeScript template.

Now before you do anything else, navigate into the MoodTracker directory, initialize a new Git repository and commit the initial template:

cd MoodTrackergit initgit branch -m maingit add --allgit commit -m "Initial commit"

It is generally a good practice to do this even if you never plan to share your project with anyone. Aim to commit your changes whenever you reach a point where you're happy with your progress. This ensures you can easily see and revert any new changes and you'll always have a solid point to go back to if things get lopsided.

tip

You can use a Git GUI like SourceTree and Fork alongside or instead of the command line cli. This can make tracking changes (especially diffs) a whole lot easier.