📌  相关文章
📜  以反应钩子形式插入 isValidPhoneNumber - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:48.245000             🧑  作者: Mango

代码示例1
import { useForm, Controller } from 'react-hook-form'
import PhoneInput, { isValidPhoneNumber } from 'react-phone-number-input'

import 'react-phone-number-input/style.css'

const MyForm = () => {
  const {
    handleSubmit,
    formState: { errors },
    control,
  } = useForm()

  const onSubmit = (data) => {
    console.log(data)
  }

  return (
    
( )} /> {errors.phone &&

Invalid Phone

}
) } export default MyForm