Replies: 1 comment
-
@sarashid, I don't understand what import {useCallback} from "react";
import {useForm} from "antd/es/form/Form";
import Form from "antd/es/form";
import Button from "antd/es/button";
import FormItem from "antd/es/form/FormItem";
const Demo = () => {
const [form] = useForm();
const updateValue = useCallback(() => {
form.setFieldValue("phone", "+1 123 456 7890");
}, [form])
return (
<Form form={form}>
<FormItem name="phone">
<PhoneInput />
</FormItem>
<Button onClick={updateValue}>Update Value</Button>
</Form>
)
} NOTE: The first argument of If by |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I'm trying to update phoneNumber by setValue form already updated but number not shown in input how I fix it ?
Beta Was this translation helpful? Give feedback.
All reactions