Closed hemengke1997 closed 2 weeks ago
我发现我也安装了 划词翻译 插件(但是不知道为什么被我禁用了,应该也是水合导致 antd 文档报错🤔)
不过你反馈这个问题太边缘了,不应该是组件库来修复问题。
水合出问题并不会导致页面无法渲染,本质是 antd css 的 findStyle 方法出错了
临时解决了,在hydrate之前把chrome插件注入的元素都删了。
function removeThirdPartyDOM() {
let sibling = document.body.nextElementSibling
while (sibling) {
const nextSibling = sibling.nextElementSibling
sibling.remove()
sibling = nextSibling
}
}
removeThirdPartyDOM()
hydrate()
Reproduction link
https://github.com/hemengke1997/antd-remix-reproduction
Steps to reproduce
pnpm i
pnpm dev
What is expected?
页面正常展示
What is actually happening?
页面报错
安装划词翻译,但没有使用antd的情况,只是报hydrate不匹配,但是不会影响页面渲染 使用了antd后,页面报错不能正常展示了