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
Icon
2.46.1
Chrome 下会有这个恼人的问题,复现代码: https://codesandbox.io/s/still-morning-qzpf4f?file=/src/App.jsx
相关文章: https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
解决方案: 组件每个实例里的 id 都改为唯一 id,这样不同实例间就不会互相受影响了。例如使用 React 18 里的 useId,还能在 SSR 中保持 id 不变
useId
No response
- OS: MacOS - browser: Chrome
The text was updated successfully, but these errors were encountered:
@DaiQiangReal 怎么看? svgr有过相关的讨论,但是他们也没有给明确的处理方案 gregberge/svgr#322 我们直接用 useId 不太可行,因为 < v18 的版本仍然是我们的主流用户使用的版本。 我看了下 semi-icons里有 defs 的不多,只有少数几个svg。
Sorry, something went wrong.
@pointhalo 会考虑把带 id 的 svg 处理一下么,尽量不依赖 id?我们项目目前打了个 patch 去掉对 id 的依赖,肉眼上好像也看不出区别
我还没详细研究过,按照我的个人理解,defs应该是相当于变量定义,use的地方相当于是引用变量。按道理不抽出声明,直接内联写,估计也ok @DaiQiangReal 确认一下
我们改
DaiQiangReal
No branches or pull requests
Is there an existing issue for this?
Which Component
Icon
Semi Version
2.46.1
Current Behavior
Chrome 下会有这个恼人的问题,复现代码:
https://codesandbox.io/s/still-morning-qzpf4f?file=/src/App.jsx
相关文章:
https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
解决方案:
组件每个实例里的 id 都改为唯一 id,这样不同实例间就不会互相受影响了。例如使用 React 18 里的
useId
,还能在 SSR 中保持 id 不变Expected Behavior
No response
Steps To Reproduce
No response
ReproducibleCode
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: