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