打字稿不识别呈渲染图标的蚂蚁设计道具

发布于 2025-01-27 17:59:17 字数 349 浏览 1 评论 0 原文

我是打字稿和蚂蚁设计的新手。我有一个密码输入,并希望在输入元素内有一个打开/隐形图标。但是TypeScript给我一个错误,IntinSiCattributes& inputprops&重新归类。我该如何解决?

<Input
 type="password"
 className={styles["password-input"]}
 placeholder="Password"
 iconRender={(visible: ReactNode) =>
  visible ? <EyeTwoTone /> : <EyeInvisibleOutlined />
 }
/>

I am new in typescript and Ant design. I have a password input and want to have an open/invisible Icon inside input element. But typescript gives me an error, iconRender does not exist on type 'IntrinsicAttributes & InputProps & RefAttributes'. How could I fix it?

<Input
 type="password"
 className={styles["password-input"]}
 placeholder="Password"
 iconRender={(visible: ReactNode) =>
  visible ? <EyeTwoTone /> : <EyeInvisibleOutlined />
 }
/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

转角预定愛 2025-02-03 17:59:17

您应该使用 input.password antd 中输入密码。查看更多:

You should use Input.Password for password input from antd. See more: https://ant.design/components/input/#components-input-demo-password-input

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文