ReactJS Antd Form validation causes crash

Viewed 14

I have a simple implementation of a required field using antd's form component. But the moment I entered something into the field and backspace-ed it, the site crashes with Async Validation Error. After proceeding with the debugger, the validation message then shows up.

I tried with the examples on antd on codesandbox and theres no issue. When I duplicate the code over to my local env, the error comes up again. https://codesandbox.io/s/r1z3dt?file=/demo.js

My Code:

<Form form={form}>
  <Form.Item label="Name" name="name" rules={[{ required: true, message: 'Name is required' }]}>
    <Input />
  </Form.Item>
</Form>

Error Message enter image description here

Seems like a pretty straight forward and common implementation of a form element. Any idea what went wrong?

0 Answers
Related