I'm migrating React-Hook-Form from v6 to v7, and I have a little problem with my custom inputs.
Here is the warning of the console at the first call of the custom input:

Here is my code of parent (form):
<form onSubmit={handleSubmit(onSubmit)}>
<div className="row">
<div className="md-8">
<div className="form-group">
<Input
name="host"
label="Adresse host *"
error={errors.host}
{...register('host')}
/>
</div>
</div>
</div>
</form>
And here code of child:
import React from 'react'
type Props = {
name?:string
label?: string
error?: any
type?: string
placeholder?: string
helper?:string
}
const Input: React.FC<Props> = (props) => {
const {name, label, error, type, placeholder, helper, ...rest} = props
return(
<div className="form-group inputText">
{label && <label htmlFor={name}>{label}</label>}
<input
type={type ?? "text"}
name={name}
placeholder={placeholder ?? ""}
className={`form-input ${error ? "form-error" : ''}`}
{...rest}/>
{!!helper && <small className="input-helper">{helper}</small>}
{error && <span className="input-error red" style={{marginBottom: 5}}>{error.type === "required" ? "Champs obligatoire" : error.message}</span>}
</div>
)
}
export default Input
The form works but the error is bothering me. And I can't remove it despite my fruitless search on the internet...
Thanks a lot !