defaultValue不起作用React useForm钩子

时间:2020-07-03 05:21:46

标签: reactjs forms react-hooks default-value react-hook-form

默认值不在第一次渲染上显示。您能告诉我如何在第一次重新加载时显示默认值吗?

<textarea
    cols="3"                                            
    name="businessDetail"
    defaultValue={businessDetail}
    ref={register({required:'required'})}
   />
  <Controller
     control={control} 
     name="businessTags" 
     as={<TagsInput />}
     defaultValue={businessTags} 
     rules={{required:'required' }} 
/>
<Controller
   as={<PhoneInput
   placeholder="+92 43 5673218"
   type="tel"  
    />}
   name="businessContact"
   control={control}
   defaultValue={businessContact}
   rules={{required:'required' }} 
   />

0 个答案:

没有答案