template-react-ts React+TypeScript启动模板

React + TypeScript 的项目起手式,template-react-ts 是个挺顺手的模板。基于 Create React App 起步,目录清爽,配置也够用,适合懒得自己折腾 webpack 的你。

直接 yarn start 就能跑起来,热更新响应挺快,适合边写边看效果。开发阶段调试舒服,出错也会有控制台提示,小问题能马上发现。

测试用 yarn test,是那种交互式的,敲一个回车继续往下测,不用每次都跑全套。项目结构挺合理,新增测试文件也方便。

打包的时候跑 yarn build,它会自动帮你压缩、加哈希,生成的文件直接就能部署。哦对,记得别手欠去 yarn eject,这个操作是单向的,一旦干了你就得自己维护一堆配置。

整体来看,这模板适合那些刚上手 TypeScript,又不想从零搭环境的同学。如果你之前用过 JS 版本的 CRA,会觉得过渡蛮自然的。想用更轻量的版本,也可以看看这个轻量模板

zip
template-react-ts-main.zip 预估大小:45个文件
folder
template-react-ts-main 文件夹
file
.gitignore 310B
file
tsconfig.json 535B
file
README.md 2KB
folder
.github 文件夹
file
template_pull_request.md 464B
file
.env 55B
folder
public 文件夹
file
manifest.json 492B
file
robots.txt 67B
file
logo192.png 5KB
file
logo512.png 9KB
file
index.html 2KB
file
favicon.ico 4KB
file
.prettierrc 78B
file
package.json 1KB
folder
src 文件夹
file
reportWebVitals.ts 425B
file
index.tsx 550B
file
index.css 366B
folder
services 文件夹
file
index.ts 23B
file
api.ts 122B
folder
utils 文件夹
folder
toasts 文件夹
file
index.ts 92B
file
error.ts 551B
file
success.ts 472B
folder
string 文件夹
file
toLocalCurrency.ts 172B
file
index.ts 35B
folder
validators 文件夹
file
isValidSearch.ts 154B
file
isValidEmail.ts 250B
file
index.ts 118B
file
index.ts 81B
folder
types 文件夹
file
Colors.d.ts 588B
file
Spacings.d.ts 206B
folder
theme 文件夹
file
Spacings.ts 199B
file
Colors.ts 1KB
file
index.ts 96B
file
App.test.tsx 273B
folder
contexts 文件夹
file
MainProvider.tsx 206B
file
SomeContext.tsx 577B
file
index.ts 63B
file
App.tsx 556B
file
react-app-env.d.ts 40B
file
App.css 564B
file
logo.svg 3KB
file
setupTests.ts 241B
file
.eslintignore 57B
file
.editorconfig 167B
file
yarn.lock 506KB
file
.eslintrc.json 1KB
zip 文件大小:227.72KB