ant-design / antd-style

css-in-js library with antd v5 token system

Home Page:https://ant-design.github.io/antd-style/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🐛[BUG] createInstance创建的StyleProvider的props类型不对

basala opened this issue · comments

🐛 bug 描述

使用createInstance创建的styleProvider的props类型不对

📷 复现步骤

import { legacyLogicalPropertiesTransformer } from "@ant-design/cssinjs";

<StyleProvider transformers={[legacyLogicalPropertiesTransformer]}}></StyleProvider>

transformers提示类型不匹配
image

🏞 期望结果

不会提示类型错误

💻 复现代码

可复现 demo

© 版本信息

  • antd-style 版本: [3.1.0]
  • 浏览器环境 [Chrome]
  • 开发环境 [mac OS]

🚑 其他信息

image

ant-design/cssinjs types路径是lib
image
这里是es

导致类型对不上了

image ant-design/cssinjs types路径是lib image 这里是es

导致类型对不上了

antd 的 cssinjs 有导出这个Context的类型么?我记得好像是因为没导出,所以我引了es

image ant-design/cssinjs types路径是lib image 这里是es 导致类型对不上了

antd 的 cssinjs 有导出这个Context的类型么?我记得好像是因为没导出,所以我引了es

看了下没导出,从antd的cssinjs import legacyLogicalPropertiesTransformer的时候路径是lib,应该是这个导致的对不上,
或者能不能改成用React.ComponentProps<typeof StyleProvider>获取下类型

从antd的cssinjs import legacyLogicalPropertiesTransformer的时候路径是lib

@basala 你改成从 es 引入呢?

从antd的cssinjs import legacyLogicalPropertiesTransformer的时候路径是lib

@basala 你改成从 es 引入呢?

image 改成这样确实不报错了

但是ant-design/cssinjs默认导入路径是lib,下面这样写就会报错
image

那感觉只要把包的前面那个 es 改成 lib 就好了?有没有兴趣来个 pr ?

那感觉只要把包的前面那个 es 改成 lib 就好了?有没有兴趣来个 pr ?

🉑️,我改了在麻烦大佬看看

好像没有合并权限,麻烦大佬看下没问题的话帮忙合并发布一下~

🎉 This issue has been resolved in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@basala 来试试

@basala 来试试

可以了,感谢大佬