ant-design/components/form/demo/dep-debug.tsx
lijianan b9a6b7b578
demo: update demo (#40318)
* demo: update demo

* add form

* clear

* add Select

* add

* fix style

* fix style

* fix

* revert
2023-01-19 15:37:54 +08:00

32 lines
701 B
TypeScript

import React from 'react';
import { Form, Input } from 'antd';
let acc = 0;
const App: React.FC = () => {
const [form] = Form.useForm();
return (
<Form
form={form}
name="debug"
initialValues={{ debug1: 'debug1', debug2: 'debug2' }}
style={{ maxWidth: 600 }}
>
<Form.Item noStyle dependencies={['debug1']}>
{
() => acc++
// return <pre>{JSON.stringify(form.getFieldsValue(), null, 2)}</pre>;
}
</Form.Item>
<Form.Item label="debug1" name="debug1">
<Input />
</Form.Item>
<Form.Item label="debug2" name="debug2">
<Input />
</Form.Item>
</Form>
);
};
export default App;