For your usecase, you can use isDirty property provided by react-hook-form. But to use it, you must have some defaultValues for the fields.
You can see the following example which is mentioned in the documentation itself,
const {
formState: { isDirty },
setValue,
} = useForm({ defaultValues: { test: "" } });
// isDirty: true
setValue('test', 'change')
// isDirty: false because there getValues() === defaultValues
setValue('test', '')
Also, check the if you are providing the defaultValues in correct manner. There might be some issues with values you are using in your code.
useForm({defaultValues:values})