毛毯 發表於 2019-5-6 15:35:00

typescript中使用antd.form.create

<p>typescript中使用antd.form.create</p>
<h4 id="报错内容如下">报错内容如下</h4>
<p>与类型“IntrinsicAttributes &amp; IntrinsicClassAttributes&lt;Component&lt;Pick&lt;FormComponentProps</any></p>
<ul>
<li>解决办法如下:</li>
</ul>
<pre><code>1 import {FormComponentProps} from 'antd/lib/form/Form';
2 interface CreateNoticeModalProps extends FormComponentProps {
isShow: boolean
onCancel: any
onOk: any
}
3 class Test extends React.Component&lt;CreateNoticeModalProps{}&gt; {}
4 最关键的
export default Form.create&lt;CreateNoticeModalProps&gt;()(CreateNoticeModal)


</code></pre><br><br>
来源:https://www.cnblogs.com/huangxingyuan/p/10819924.html
頁: [1]
查看完整版本: typescript中使用antd.form.create