Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update watch observer value type to use DeepPartialSkipArrayKey #11703

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion reports/api-extractor.md
Expand Up @@ -864,7 +864,7 @@ export type ValidationValueMessage<TValidationValue extends ValidationValue = Va
export type WatchInternal<TFieldValues> = (fieldNames?: InternalFieldName | InternalFieldName[], defaultValue?: DeepPartial<TFieldValues>, isMounted?: boolean, isGlobal?: boolean) => FieldPathValue<FieldValues, InternalFieldName> | FieldPathValues<FieldValues, InternalFieldName[]>;

// @public (undocumented)
export type WatchObserver<TFieldValues extends FieldValues> = (value: DeepPartial<TFieldValues>, info: {
export type WatchObserver<TFieldValues extends FieldValues> = (value: DeepPartialSkipArrayKey<TFieldValues>, info: {
name?: FieldPath<TFieldValues>;
type?: EventType;
}) => void;
Expand Down
4 changes: 2 additions & 2 deletions src/types/form.ts
Expand Up @@ -21,7 +21,7 @@ import {
FieldPathValues,
} from './path';
import { Resolver } from './resolvers';
import { DeepMap, DeepPartial, Noop } from './utils';
import { DeepMap, DeepPartial, DeepPartialSkipArrayKey, Noop } from './utils';
import { RegisterOptions } from './validator';

declare const $NestedValue: unique symbol;
Expand Down Expand Up @@ -821,7 +821,7 @@ export type Control<
};

export type WatchObserver<TFieldValues extends FieldValues> = (
value: DeepPartial<TFieldValues>,
value: DeepPartialSkipArrayKey<TFieldValues>,
info: {
name?: FieldPath<TFieldValues>;
type?: EventType;
Expand Down