import React from "react"; import { MultiSelect, MultiSelectProps } from "@mantine/core"; import { useController, FieldValues, UseControllerProps, } from "react-hook-form"; type Props = MultiSelectProps & { name: UseControllerProps["name"]; rules?: UseControllerProps["rules"]; defaultValue?: UseControllerProps["defaultValue"]; }; function RHFMultiSelect(props: Props) { const { name, rules, defaultValue, ...others } = props; const { field, fieldState: { error }, } = useController({ name, rules }); return ( ); } export default RHFMultiSelect; export const createMultiSelectField = () => { const Field = (props: Props) => ; return Field; };