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