React Typescript 模板

此模板为开启 Typescript 的 React 项目提供入门级模板。它不使用 create-react-app,而是使用基本的 Babel/Webpack 设置来创建一个更加可定制的模板。该模板已预设好使用 Jest/RTL 进行测试,并使用 react-intl-hooks 实现本地化。主题特意留空,由用户决定(Material UI/Tailwind/Bootstrap 等)。 文档参考 npm,也可使用 yarn。

设置

  • 安装 npm/yarn 并启动

推荐 VSCode 扩展

  • 若干扩展可使 VSCode 开发更轻松

可用脚本

  • npm run dev:开发模式运行应用
  • npm test:React 测试库单元测试套件运行 JestRunner
  • npm run build:dist 文件夹中创建静态 HTML/JS
  • npm run start
zip
react-typescript-template-main.zip 预估大小:24个文件
folder
react-typescript-template-main 文件夹
file
.eslintrc.js 967B
file
webpack.config.js 1KB
file
.prettierignore 64B
folder
src 文件夹
file
index.html 261B
file
index.tsx 153B
folder
utils 文件夹
file
test-utils.tsx 1KB
folder
components 文件夹
folder
App 文件夹
file
App.test.tsx 629B
file
App.tsx 438B
folder
SampleComponent 文件夹
file
SampleComponent.tsx 326B
file
SampleComponent.test.tsx 676B
folder
types 文件夹
file
types.ts 31B
folder
translations 文件夹
file
en.json 51B
folder
hooks 文件夹
folder
useLocalization 文件夹
file
useLocalization.ts 380B
file
.babelrc 70B
folder
.vscode 文件夹
file
settings.json 52B
file
tsconfig.json 597B
file
jest.config.js 867B
file
.prettierrc 101B
file
README.md 3KB
file
setupTests.js 49B
file
.gitignore 35B
file
.eslintignore 311B
file
package-lock.json 590KB
file
package.json 2KB
zip 文件大小:146.26KB