Modify: README to show my learning process.

This commit is contained in:
2025-09-17 22:50:21 +08:00
parent aaf675c8da
commit 85aeb32546
2 changed files with 19 additions and 25 deletions

View File

@@ -1,4 +1,16 @@
# Rsbuild project # React Tic-Tac-Toe Project
## 本项目中我学到了:
1. 使用了 **Bun** 作为 Runtime 使用了 **Biome** 作为了 Code Linting & Formatting 工具,使用 **rsbuild****rspack** 作为构建工具和 Bundler。
2. 了解了 React 中 **useState** 的作用,知道了状态不可变,所以需要使用 useState 作为钩子创建新的状态。
3. 了解了 React 中 状态提升和 Props 向下传递概念,使得代码中子组件尽量简单,只负责展示数据和触发事件,而父组件进行状态管理和逻辑处理以及调用子组件。
4. 创建了 **interface** 接口来配合了 TS 中的强类型检查,并进行了复用。
5. 了解到了一些 js/ts 中的一部分语法糖。
## Setup ## Setup
@@ -10,27 +22,20 @@ pnpm install
## Get started ## Get started
Start the dev server, and the app will be available at [http://localhost:3000](http://localhost:3000). 启动服务器,之后服务会跑在 [http://localhost:3000](http://localhost:3000).
```bash ```bash
pnpm dev bun run dev
``` ```
Build the app for production: 构建网页:
```bash ```bash
pnpm build bun run build
``` ```
Preview the production build locally: 在构建前进行预览:
```bash ```bash
pnpm preview bun run preview
``` ```
## Learn more
To learn more about Rsbuild, check out the following resources:
- [Rsbuild documentation](https://rsbuild.rs) - explore Rsbuild features and APIs.
- [Rsbuild GitHub repository](https://github.com/web-infra-dev/rsbuild) - your feedback and contributions are welcome!

11
src/env.d.ts vendored
View File

@@ -1,11 +0,0 @@
/// <reference types="@rsbuild/core/types" />
/**
* Imports the SVG file as a React component.
* @requires [@rsbuild/plugin-svgr](https://npmjs.com/package/@rsbuild/plugin-svgr)
*/
declare module '*.svg?react' {
import type React from 'react';
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
}