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]: Icon 结合 ts 编译Bug #723

Open
2 tasks done
szl-shalom opened this issue May 31, 2024 · 10 comments
Open
2 tasks done

🐛 [Bug]: Icon 结合 ts 编译Bug #723

szl-shalom opened this issue May 31, 2024 · 10 comments

Comments

@szl-shalom
Copy link

Which React Vant packages are impacted?

  • react-vant (React Vant core)
  • react-vant-icons(React Vant Icon)

What version of React Vant are you using?

3.35

Reproduce live demo(codesandebox or stackblitz)?

No response

Descripition

使用的React-vant 版本是 3.3.5 node 版本 18.20 React 版本 18.3.1

@szl-shalom
Copy link
Author

ts 提示

@szl-shalom
Copy link
Author

类型“{}”缺少类型“Pick<Omit<IconBaseProps, "name">, "string" | "filter" | "fill" | "values" | "id" | "children" | "className" | "onClick" | "spin" | "rotate" | "style" | "color" | ... 457 more ... | "onPointerLeaveCapture">”中的以下属性: onPointerEnterCapture, onPointerLeaveCapture icon ts 警告

@szl-shalom
Copy link
Author

解决方案 :
<ArrowLeft
onPointerEnterCapture={() => {}}
onPointerLeaveCapture={() => {}}
/>

@szl-shalom
Copy link
Author

官网也修复下类型吧

@3lang3
Copy link
Owner

3lang3 commented Jun 6, 2024

@szl-shalom 方便提pr吗

@wennjie
Copy link
Contributor

wennjie commented Jun 6, 2024

#721 已处理 但是打包失败

@szl-shalom
Copy link
Author

原来的问题是, 在编码的时候, 咱们ts检测的类型有问题, 组件是icon图表
WechatIMG796
后来我在下载了其他项目, 官方大大应该解决了这个问题
WechatIMG795

@szl-shalom
Copy link
Author

我在用这个icon 图标的时候, 会出现如下ts类型检测问题
image
当时我的解决方案就是加上了这两个属性, 让ts暂时检测通过
image

@szl-shalom
Copy link
Author

@szl-shalom 方便提pr吗

看下下面我回复呢

@beilo
Copy link

beilo commented Jul 1, 2024

使用react和 react-dom 是 18.2 能暂时解决这个问题。
并且如果使用 18.3 版本,控制台会有个 defaultProps 的警告。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants