weapon_shop React入门项目

入门级的 React 项目就选weapon_shop,整体结构清爽,脚本命令也都配好了。用yarn start一跑,页面立马起飞,热更新也比较稳定,改完立刻就能看到效果,调试挺方便。

yarn test会进一个交互式测试模式,像写完组件想随手测一下,快就能验证。有时候你想知道改动有没有破坏逻辑,这个测试命令就挺省事。

再说打包,yarn build出来的文件走的是webpack优化过的路径,生成结果小巧又清晰,命名也带了哈希,部署到线上的时候比较安心。

项目还了yarn eject,如果你觉得Create React App的封装不够灵活,想改 webpack 配置啥的,eject 之后你就可以自己完全掌控构建流程。不过注意,一旦执行了就回不去了,适合对构建有研究的同学。

想要了解更多ReactWebpack相关的构建技巧,可以看看React App Development and Build Commands,还有webpack-react:配置 React 的 Webpack这些,配合起来理解更透彻。

如果你刚入门 React 开发,weapon_shop算是个比较友好的起点,功能全、脚本明晰,也挺适合改着玩。如果你想试着改下配置或搭配 TypeScript,也可以看看CreateReactApp with TypeScript A Beginner’s Guide

zip
weapon_shop-main.zip 预估大小:48个文件
folder
weapon_shop-main 文件夹
file
package.json 1KB
folder
src 文件夹
file
App.css 32B
file
react-app-env.d.ts 40B
file
reportWebVitals.ts 425B
file
index.tsx 500B
folder
components 文件夹
folder
slider 文件夹
file
Slider.jsx 1KB
folder
loginModal 文件夹
file
LoginPage.module.scss 1KB
folder
Register 文件夹
file
Register.module.scss 1KB
file
Register.tsx 1KB
file
LoginModal.tsx 1KB
folder
LoginModal.module.scss 文件夹
file
LoginPage.tsx 1KB
folder
Login 文件夹
file
Login.tsx 1018B
file
Login.module.scss 1KB
folder
headPage 文件夹
file
backgroudImg.ts 484B
file
HeadPage.tsx 1KB
file
HeadPage.module.scss 3KB
folder
title 文件夹
file
Title.tsx 220B
file
Title.module.scss 235B
folder
homePage 文件夹
file
HomePage.tsx 303B
folder
itemList 文件夹
file
ItemList.module.scss 345B
file
ItemList.tsx 726B
folder
products 文件夹
folder
ProductItem 文件夹
file
ProductItem.tsx 749B
file
ProductItem.module.scss 1KB
file
Products.tsx 638B
file
rifles.ts 7KB
file
Products.module.scss 377B
folder
button 文件夹
file
Button.tsx 274B
file
Button.module.scss 383B
folder
header 文件夹
folder
nav 文件夹
file
Nav.tsx 217B
file
Nav.module.scss 200B
file
App.tsx 515B
file
setupTests.ts 241B
file
App.test.tsx 273B
file
index.css 366B
folder
.idea 文件夹
file
modules.xml 274B
file
weapon_shop.iml 514B
file
.gitignore 98B
file
tsconfig.json 535B
file
.gitignore 318B
folder
public 文件夹
file
logo192.png 5KB
file
manifest.json 492B
file
robots.txt 67B
file
index.html 2KB
file
logo512.png 9KB
file
favicon.ico 4KB
file
README.md 2KB
file
yarn.lock 505KB
zip 文件大小:235.74KB