import React from "react"; import { Select, SelectProps } from "@mantine/core"; import { useController, FieldValues, UseControllerProps, } from "react-hook-form"; type Props = SelectProps & { name: UseControllerProps["name"]; rules?: UseControllerProps["rules"]; defaultValue?: UseControllerProps["defaultValue"]; }; function RHFSelect(props: Props) { const { name, rules, defaultValue, ...others } = props; const { field, fieldState: { error }, } = useController({ name, rules }); return (