React 应用开发指南

本指南介绍如何使用 Create React App 工具进行 React 应用开发,并详细说明常用的开发命令及功能。

开发环境搭建

  1. 确保已安装 Node.js 和 yarn。
  2. 使用 Create React App 初始化项目:

    bash

    npx create-react-app my-app

    cd my-app

启动开发服务器

在项目根目录下运行以下命令启动开发服务器:

yarn start

该命令会在浏览器中自动打开 http://localhost:3000/ 地址,并实时显示代码修改后的效果。

运行测试

yarn test

该命令会启动测试运行程序,并进入交互式监视模式,实时显示测试结果。

构建生产环境代码

yarn build

该命令会将 React 应用打包到 build 文件夹中,并进行代码压缩、优化等处理,以提高应用的加载速度和性能。

移除构建依赖

yarn eject

注意: 该操作不可逆。执行后,将无法恢复到 Create React App 的默认配置。

该命令会将 Create React App 的所有配置和依赖项复制到项目中,方便开发者进行自定义配置。

zip
Keepers_github_io-master.zip 预估大小:81个文件
folder
Keepers.github.io-master 文件夹
folder
public 文件夹
file
manifest.json 492B
file
index.html 2KB
file
robots.txt 67B
file
favicon.ico 4KB
file
logo512.png 9KB
file
logo192.png 5KB
file
yarn.lock 503KB
folder
src 文件夹
file
index.html 909B
file
index.tsx 500B
file
logo.svg 3KB
file
index.css 5KB
file
App.test.tsx 273B
folder
assets 文件夹
file
confirm.svg 1KB
file
Vodafone.svg 13KB
file
aws@2x.png 18KB
file
whitecopy3.svg 15KB
file
googlePlay.png 6KB
file
horizon@2x.png 30KB
file
Group3.png 293KB
file
woman.png 102KB
file
appstore.png 5KB
file
iPhone122.png 76KB
file
Group3MobileS.png 97KB
file
horizontalDials.svg 1KB
file
rekuten@2x.png 10KB
folder
js 文件夹
file
popper.js 21KB
file
holder.min.js 8KB
file
ie10-viewport-bug-workaround.js 641B
file
jquery.min.js 86KB
file
ie-emulation-modes-warning.js 2KB
file
holder.js 14KB
file
google@2x.png 15KB
file
vodafone@2x.png 12KB
file
allot@2x.png 9KB
file
deloitte@2x.png 7KB
file
hut@2x.png 10KB
file
iPhone121.png 35KB
file
iPhone125.png 50KB
file
locationPin.svg 1022B
file
alert.svg 1KB
file
plus.svg 143B
file
iia@2x.png 16KB
file
bezeq@2x.png 16KB
file
whitecopy2.svg 15KB
file
phoneSmartphone.svg 837B
file
white.svg 26KB
file
signup.png 162KB
file
clock.svg 831B
file
iPhone124.png 41KB
file
iPhone123.png 70KB
file
signupxl.png 476KB
folder
fonts 文件夹
file
Barlow-SemiBold.ttf 46KB
file
Barlow-SemiBold.woff 23KB
file
Barlow-Regular.svg 86KB
file
Barlow-Regular.ttf 46KB
file
Barlow-Regular.eot 46KB
file
Barlow-SemiBold.eot 47KB
file
Barlow-SemiBold.svg 86KB
file
Barlow-Regular.woff 23KB
file
App.css 564B
file
App.tsx 33KB
file
react-app-env.d.ts 40B
file
setupTests.ts 241B
folder
style.css 文件夹
file
reportWebVitals.ts 425B
folder
Images 文件夹
folder
inspect 文件夹
folder
keepers brand images 文件夹
folder
Page 1 文件夹
folder
Artboard Copy 文件夹
file
google.png 6KB
file
hut.png 5KB
file
aws.png 6KB
file
allot.png 4KB
file
iia.png 6KB
file
bezeq.png 5KB
file
horizon.png 10KB
file
deloitte.png 4KB
file
rekuten.png 4KB
file
vodafone.png 5KB
file
tsconfig.json 535B
file
README.md 2KB
file
.gitignore 310B
file
package-lock.json 1.38MB
file
package.json 1KB
file
inspect-assets (12).zip 13KB
...
zip 文件大小:2.38MB