Closed IamFive closed 1 year ago
有个相似的问题,不知是不是用的不对。使用antd-style在基于 antd 二次封装的组件库时,使用了createInstance这个API,并使用这个API返回对象中的StyleProvider去指定container,但是没有生效
<StyleProvider container={document.body}>
<MyComponent></MyComponent>
</StyleProvider>
:tada: This issue has been resolved in version 3.0.1-beta.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@IamFive 试试上面这个版本
@IamFive 试试上面这个版本
我使用的代码如下:
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>
);
好像是还有点问题,我再修下
与 #47 重复,合并到 #47 中讨论,这个先关了
:tada: This issue has been resolved in version 3.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
🥰 需求描述
支持使用
antd
的style-provider
, 让用户自由指定css的插入位置。https://github.com/ant-design/cssinjs#styleprovider
🧐 解决方案
🚑 其他信息