Skip to content
New issue

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

StyleProvider对于shadowdom场景,Image组件样式丢失 #48955

Closed
AntiMoron opened this issue May 17, 2024 · 4 comments
Closed

StyleProvider对于shadowdom场景,Image组件样式丢失 #48955

AntiMoron opened this issue May 17, 2024 · 4 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem

Comments

@AntiMoron
Copy link

Steps to reproduce

看样式

image

What is expected?

样式不要丢失

What is actually happening?

  1. 创建了一个shadowroot
  2. 把shadowroot提供给styleprovider
  3. 这个provider包裹整个react-router的路由
  4. 集成到页面的时候样式丢失
    // Create the shadow root
    const shadowRoot = container.attachShadow({ mode: 'open' }) as ShadowRoot;
    document.body.append(container);
    const root = ReactDOM.createRoot(shadowRoot);
    root.render(
      <RecoilRoot>
        <StyleProvider container={shadowRoot}>
          <Context.Provider value={{ targetRoot: shadowRoot }}>
            <div className={styles.mainContainer}>
              <Lancher conf={windowConf} shadowRoot={shadowRoot} />
            </div>
          </Context.Provider>
        </StyleProvider>
      </RecoilRoot>,
    );
Environment Info
antd 5.17.2
React 18.2.0
System macos 13.0 (22A380)
Browser chrome 124.0.6367.207
@zombieJ zombieJ added 🤔 Need Reproduce We cannot reproduce your problem and removed unconfirmed labels May 17, 2024
Copy link
Contributor

Hello @AntiMoron. Please provide a online reproduction by forking codesandbox of antd@5.x or antd@4.x, or provide a minimal GitHub repository. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @AntiMoron,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击这里创建一个 antd@5.xantd@4.x 的 codesandbox,或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

@AntiMoron
Copy link
Author

无视2楼,嘻!嘻!

@AntiMoron
Copy link
Author

此问题在历史已Close Issue中也有提及:

#38911 (comment)

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
@AntiMoron
Copy link
Author

呜呜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

No branches or pull requests

2 participants