mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
chore: sync feature into next
This commit is contained in:
@@ -274,6 +274,10 @@ If you encounter the above error, please check the current project `tsconfig.jso
|
||||
|
||||
The above problem occurs if `strictNullChecks` is set to `true`, If you can determine the project don't need this configuration (see [strictNullChecks](https://www.typescriptlang.org/zh/tsconfig#strictNullChecks) to judge whether need the configuration). You can try changing to `false` to turn off the control strict check. However, if you do need to enable this feature, you can avoid this situation by using other types instead of `null` when defining types
|
||||
|
||||
## Why doesn't antd handle precision issues encountered with browser zoom?
|
||||
|
||||
Different browsers have different rendering behaviors when zooming. Fixing a precision issue in one browser often leads to issues in others. Additionally, zoom-related precision issues typically occur at extreme zoom levels, which are uncommon in regular use. The inconsistency in rendering arises from how browsers calculate and render elements during zoom operations, including subpixel rendering, rounding differences, and layout recalculations. Addressing these issues requires a significant amount of browser-specific code, which can negatively impact performance and maintainability, and may also be broken by iterations in the browsers themselves.
|
||||
|
||||
## The antd component reported an error when using the App Router of Next.js
|
||||
|
||||
If you are using the App Router of Next.js, when you use the sub-components provided by some antd components, such as `Select.Option `, `Form.Item`, `Typography.Title`, etc., you may get the following error:
|
||||
|
||||
@@ -298,6 +298,10 @@ export default () => {
|
||||
|
||||
如果 `strictNullChecks` 的值被设置为 `true` 就会出现上述问题,如果你确定项目中可以不需要这个检测配置(查看[strictNullChecks](https://www.typescriptlang.org/zh/tsconfig#strictNullChecks)判断是否需要该配置),可以尝试改为 `false` 关闭控制严格检查功能。但如果你确实需要开启这个功能,那么,你可以在设计类型时,使用其他类型替代 `null` 以避免出现这种情况。
|
||||
|
||||
## 为什么 antd 不处理浏览器缩放遇到的精度问题?
|
||||
|
||||
不同浏览器对缩放的渲染行为不同,修复一个浏览器的精度问题往往会导致其他浏览器出现问题。此外,缩放相关的精度问题通常出现在极端缩放级别下,这在常规使用中并不常见。渲染不一致的问题源于浏览器在缩放操作期间计算和渲染元素的方式,包括亚像素渲染、舍入差异和布局重新计算。解决这些问题需要大量的浏览器特定代码,这会对性能和可维护性产生负面影响,并且这些代码也可能因浏览器版本更新而失效。
|
||||
|
||||
## 使用 Next.js 的 App Router 时 antd 组件报错
|
||||
|
||||
如果你在使用 Next.js 的 App Router,当你使用 antd 中某些组件提供的子组件,如:`Select.Option`、`Form.Item`、`Typography.Title` 等,可能会出现如下报错:
|
||||
|
||||
Reference in New Issue
Block a user