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

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

Closed
basala opened this issue May 11, 2023 · 11 comments · Fixed by #51
Closed

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

basala opened this issue May 11, 2023 · 11 comments · Fixed by #51
Labels

Comments

@basala
Copy link
Contributor

basala commented May 11, 2023

🐛 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]

🚑 其他信息

@basala
Copy link
Contributor Author

basala commented May 11, 2023

image

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

导致类型对不上了

@arvinxx
Copy link
Collaborator

arvinxx commented May 11, 2023

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

导致类型对不上了

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

@basala
Copy link
Contributor Author

basala commented May 11, 2023

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

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

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

@arvinxx
Copy link
Collaborator

arvinxx commented May 11, 2023

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

@basala 你改成从 es 引入呢?

@basala
Copy link
Contributor Author

basala commented May 12, 2023

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

@basala 你改成从 es 引入呢?

image 改成这样确实不报错了

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

@arvinxx
Copy link
Collaborator

arvinxx commented May 12, 2023

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

@basala
Copy link
Contributor Author

basala commented May 12, 2023

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

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

basala pushed a commit to basala/antd-style that referenced this issue May 12, 2023
@basala
Copy link
Contributor Author

basala commented May 12, 2023

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

@github-actions
Copy link

🎉 This issue has been resolved in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@arvinxx
Copy link
Collaborator

arvinxx commented May 15, 2023

@basala 来试试

@basala
Copy link
Contributor Author

basala commented May 16, 2023

@basala 来试试

可以了,感谢大佬

@basala basala closed this as completed May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants