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

typescript使用antd Form组件问题 #2885

Closed
infeng opened this issue Aug 30, 2016 · 4 comments
Closed

typescript使用antd Form组件问题 #2885

infeng opened this issue Aug 30, 2016 · 4 comments

Comments

@infeng
Copy link
Contributor

infeng commented Aug 30, 2016

本地环境

  • antd 版本: 1.10.0
  • 操作系统及其版本: windows10
  • 浏览器及其版本: crhome 54.0.2832.2 dev-m (64-bit)

你做了什么?

使用typescript去写react,用到了antd的Form组件
经过 Form.create 包装了一个组件,在其他组件里面使用这个组件

你期待的结果是:

没有提示错误

实际上的结果:

如果组件属性定义的form是可选,Form.create()会提示错误;
如果组件属性定义的form是必须,Form.create()不会提示错误,但是使用这个组件的时候,会提示没有设置form属性

可重现的在线演示

http://codepen.io/infeng/pen/qaWbpE?editors=0010

@benjycui
Copy link
Contributor

console 无任何报错信息。

@infeng
Copy link
Contributor Author

infeng commented Aug 30, 2016

是typescript的语法检查会提示错误

afc163 added a commit that referenced this issue Aug 30, 2016
@afc163 afc163 closed this as completed Aug 30, 2016
@nick-ChenZe
Copy link
Contributor

通过typings install安装的依旧存在这个问题,改有官方npm包里index.d.ts后通过。

@lock
Copy link

lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants