We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spin
2.46.2
在 Next 中使用 会导致 console 出现如下错误。包括通过 <Table loading={true} /> 的间接使用。
<Table loading={true} />
Warning: Prop `id` did not match. Server: "linearGradient-0" Client: "linearGradient-1"
如果 next build 后通过 next start 在生产环境运行,则会产生:
Minified React error #425 (或 #418)
不应该产生报错
在 Next 项目中,尤其是 App Router 中新建一个页面,然后引入 组件
'use client' import { Spin } from "@douyinfe/semi-ui"; export default function Page() { return ( <div> <Spin /> </div> ) }
- OS: MacOS - browser: Chrome 121
semi-design/packages/semi-ui/spin/icon.tsx
Line 21 in 185222a
Spin 的 Icon 组件通过修改全局变量来计算 id,而 Next 服务端环境对组件的加载次数和逻辑与浏览器端是不同的,所以导致一个计算出了 0,一个计算出了 1 (甚至有时候会是 3)。且不论对 Next 这种框架的影响,这样写本身也是一个 anti-pattern。使用 uuid 来生成应该可以解决这个问题。
The text was updated successfully, but these errors were encountered:
跟 #1905 是一个问题。这里用 uuid 也没法解决,应该用 useId 或者移除组件里 id 的使用来解决(根据官方团队的信息,应该会选后者
Sorry, something went wrong.
DaiQiangReal
No branches or pull requests
Is there an existing issue for this?
Which Component
Spin
Semi Version
2.46.2
Current Behavior
在 Next 中使用 会导致 console 出现如下错误。包括通过
<Table loading={true} />
的间接使用。如果 next build 后通过 next start 在生产环境运行,则会产生:
Expected Behavior
不应该产生报错
Steps To Reproduce
在 Next 项目中,尤其是 App Router 中新建一个页面,然后引入 组件
ReproducibleCode
Environment
Anything else?
semi-design/packages/semi-ui/spin/icon.tsx
Line 21 in 185222a
Spin 的 Icon 组件通过修改全局变量来计算 id,而 Next 服务端环境对组件的加载次数和逻辑与浏览器端是不同的,所以导致一个计算出了 0,一个计算出了 1 (甚至有时候会是 3)。且不论对 Next 这种框架的影响,这样写本身也是一个 anti-pattern。使用 uuid 来生成应该可以解决这个问题。
The text was updated successfully, but these errors were encountered: