Giter Club home page Giter Club logo

Comments (7)

taiyangzaitianshang avatar taiyangzaitianshang commented on May 30, 2024

有个相似的问题,不知是不是用的不对。使用antd-style在基于 antd 二次封装的组件库时,使用了createInstance这个API,并使用这个API返回对象中的StyleProvider去指定container,但是没有生效

<StyleProvider container={document.body}>
      <MyComponent></MyComponent>
    </StyleProvider>

from antd-style.

github-actions avatar github-actions commented on May 30, 2024

🎉 This issue has been resolved in version 3.0.1-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

from antd-style.

arvinxx avatar arvinxx commented on May 30, 2024

@IamFive 试试上面这个版本

from antd-style.

IamFive avatar IamFive commented on May 30, 2024

@IamFive 试试上面这个版本

  1. antd 的 style 现在可以正常插入到指定的container中了。
  2. antd-style 生成的css还是插入到了host page的document.head中。

我使用的代码如下:

import { extractStaticStyle, StyleProvider as AntdStyleProvider } from "antd-style";
  const app = (
    // <React.StrictMode>
    <ConfigProvider
      getPopupContainer={() => popupContainer}
      theme={{
        token: {
          colorPrimary: "#00b96b",
        },
        // algorithm: theme.compactAlgorithm,
      }}
    >
      <AntdStyleProvider container={head}>
      {/* <StyleProvider container={head}> */}
        <style type="text/css">{sanitize}</style>
        <style type="text/css">{a1}</style>
        <style type="text/css">{a2}</style>
        <style type="text/css">{c1}</style>
        <style type="text/css">{md2}</style>
        <style type="text/css">{md3}</style>
        <style type="text/css">{md1}</style>
        <style type="text/css">{compose}</style>
        <AppLauncher />
      {/* </StyleProvider> */}
      </AntdStyleProvider>
    </ConfigProvider>
    // </React.StrictMode>
  );

from antd-style.

arvinxx avatar arvinxx commented on May 30, 2024

好像是还有点问题,我再修下

from antd-style.

arvinxx avatar arvinxx commented on May 30, 2024

#47 重复,合并到 #47 中讨论,这个先关了

from antd-style.

github-actions avatar github-actions commented on May 30, 2024

🎉 This issue has been resolved in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from antd-style.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.