Skip to content

Conversation

@louhaojie99
Copy link
Member

@louhaojie99 louhaojie99 commented Dec 25, 2025

📝 Description

site 文档站点项目缺失 react 相关 types 包。

🖼️ Screenshot

Before After

💡 Motivation and Context

🧩 Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

🔍 Self Check before Merge

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @louhaojie99, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在解决文档站点项目中存在的 React 类型依赖缺失问题。通过引入必要的类型定义包,确保了开发环境的类型检查正确性,从而提升了开发体验并避免了潜在的类型相关错误。

Highlights

  • 修复 React 类型错误: 解决了文档站点项目中因缺少 React 相关类型定义包导致的类型错误。
  • 新增开发依赖: 在 site/package.json 中添加了 @types/react@types/react-dom 作为开发依赖。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@louhaojie99 louhaojie99 requested a review from hustcc December 25, 2025 12:15
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 旨在修复文档站点的 React 类型问题,通过添加 @types/react@types/react-dom 依赖。然而,对于 React 19,这种做法是不正确的,因为 React 19 已经内置了其 TypeScript 类型。添加这些独立的 @types 包可能会与内置类型产生冲突,导致更难以排查的问题。因此,我建议移除这些新增的依赖,并从其他方面(例如 tsconfig.json 配置或检查其他依赖项与 React 19 的兼容性)来解决根本的类型错误问题。

Comment on lines +40 to +41
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

你好,此更改添加了 @types/react@types/react-dom,但对于 React 19 来说这是不必要的,甚至可能是有害的。

React 19 已将 TypeScript 类型定义内置于包中。因此,单独安装 @types 包会导致类型定义重复,并可能引发难以诊断的冲突错误。

建议移除这两个依赖项,并调查原始类型错误的根本原因。这可能与 tsconfig.json 中的配置或项目中其他尚未完全兼容 React 19 的依赖项(例如 dumi)有关。

更多信息请参阅 React 19 Beta 公告

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看下 @louhaojie99

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实是,react v19 新版本不依赖了 @types/react 和 @types/react-dom。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants