Files
React-TicTac/README.md
2025-09-17 22:51:45 +08:00

42 lines
1018 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
安装依赖:
```bash
bun install
```
## Get started
启动服务器,之后服务会跑在 [http://localhost:3000](http://localhost:3000).
```bash
bun run dev
```
构建网页:
```bash
bun run build
```
在构建前进行预览:
```bash
bun run preview
```