-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ref prop support #64
Labels
enhancement
New feature or request
Comments
6 tasks
Hi @solo-bog-uptech, thanks for opening the issue. I have already added support for import Button from "antd/es/button";
import PhoneInput from "antd-phone-input";
import {useForm} from "react-hook-form";
const Demo = () => {
const {register, handleSubmit} = useForm();
const phoneRegister = register("phone", {
validate: ({valid = () => false}: any = {}) => valid(),
});
const onChange = (value: any) => phoneRegister.onChange({target: {value, name: phoneRegister.name}});
return (
<form onSubmit={handleSubmit(console.log)}>
<PhoneInput
enableSearch
{...phoneRegister}
onChange={onChange}
/>
<Button htmlType="submit">Submit</Button>
</form>
)
}
export default Demo; |
Closing the issue because of inactivity. The changes will be available in the next release. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
I use react-hook-form lib for handling forms and it needs
ref
prop inPhoneInput
component.The text was updated successfully, but these errors were encountered: