📜  react native new project mac - Javascript(1)

📅  最后修改于: 2023-12-03 15:34:38.616000             🧑  作者: Mango

React Native New Project on Mac - JavaScript

Introduction

React Native is a popular JavaScript framework for building native mobile applications for iOS and Android. In this guide, you will learn how to create a new React Native project on a Mac using JavaScript.

Prerequisites

Before you begin, you should have the following installed on your Mac:

  • Node.js
  • Watchman
  • React Native CLI
Steps

To create a new React Native project on a Mac using JavaScript, follow these steps:

  1. Open a terminal window and navigate to the directory where you want to create your project.
cd /path/to/directory
  1. Run the following command to create a new React Native project using the react-native-cli.
react-native init <project-name>

Replace <project-name> with the name of your project.

  1. Wait for the project to be created. This may take a few minutes.

  2. Once the project is created, navigate to the project directory and start the React Native development server.

cd <project-name>
npm start
  1. If you have an iOS simulator installed, you can run your app using the following command:
react-native run-ios
  1. If you have an Android emulator installed or a device connected, run your app using the following command:
react-native run-android

Note: You may need to start the emulator or connect the device before running this command.

Conclusion

In this guide, you learned how to create a new React Native project on a Mac using JavaScript. With React Native, you can build high-quality mobile applications for iOS and Android with a single codebase. Happy coding!