I have a custom component for a select input as below. i am passing regResult
as a prop to this component. regResult
is of type regResult: UseFormRegister;
which is a register method.
<CustomSelect
name="id"
placeholder={User Id}
regResult={register("id", {
onChange: (e) => console.log(e)
})}
doctorList={filteredDoctorList}
disabled={!iChecked}
/>
export declare type UseFormRegister= {
onChange: ChangeHandler;
onBlur: ChangeHandler;
ref: RefCallBack;
name: InternalFieldName;
};
onChange: (e) => console.log(e) // is throwing error "Argument of type '{ onChange: (e: any) => void; }' is not assignable to parameter of type 'Partial"
can anyone tell me what exactly is the issue here. Thanks in advance