啟動

create-react-app

# create new app
npx create-react-app my-app      # new app (`my-app` subfolder created)
cd my-app                        # change to app directory

# starts the development server
# (default browser launch automatically at http://localhost:3000/)
npm start

# app code resides in `src` folder
# (App.js, index.js, ...)

WARNING 🧨

create-react-app automatically makes the project a git repository unless the application is created within an already existing repository. Most likely you do not want the project to become a repository, so run the following command in the root of the project.

# remove git repository
rm -rf .git

Last updated