antd form和next js生成TypeError: window.setTimeout is not a function error

时间:2021-03-10 19:30:28

标签: reactjs forms next.js antd

我是下一个 js 的新手,当我遇到这个错误时,我试图用 antd 组件库创建一个表单。当我排除标签时,页面会正确呈现。但我无法让它与完整的表单设置一起工作。 我做错了什么?

 <Form size='large'   
 labelCol={{ span: 4 }}
wrapperCol={{ span: 9 }}
>

<Form.Item>
<Space>
<Form.Item
    rules={[{ required: true, message: 'Missing first name' }]}
>
  <Input placeholder="First Name" />
</Form.Item>

<Form.Item
 
  rules={[{ required: true, message: 'Missing last name' }]}
>
<Input placeholder="Last Name" />
</Form.Item>
</Space>
</Form.Item>
   <Form.Item
 
 rules={[{ required: true, message: 'Missing Phone Number' }]}
>
 <Input placeholder="Phone Number" />
</Form.Item>



</Form> 

产生的错误如下

Server Error
TypeError: window.setTimeout is not a function

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
FormStore.warningUnhooked
file:///D:/School%20Management/School%20Management/node_modules/rc-field-form/lib/useForm.js (127:32)
FormStore.getFieldsValue
file:///D:/School%20Management/School%20Management/node_modules/rc-field-form/lib/useForm.js (183:11)
Field._this.getValue
file:///D:/School%20Management/School%20Management/node_modules/rc-field-form/lib/Field.js (393:48)
Field._this.getControlled
file:///D:/School%20Management/School%20Management/node_modules/rc-field-form/lib/Field.js (416:25)
Field._this.getOnlyChild
file:///D:/School%20Management/School%20Management/node_modules/rc-field-form/lib/Field.js (366:110)
Field.render

提前致谢。

0 个答案:

没有答案