Skip to content

Commit

Permalink
Revert "🚔 close #8653 when useFormContext provide no generic for type…
Browse files Browse the repository at this point in the history
… check (#8654)"

This reverts commit 2e0c3f8.
  • Loading branch information
bluebill1049 committed Jul 9, 2022
1 parent 34af5b3 commit 4f649b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion reports/api-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ export function useForm<TFieldValues extends FieldValues = FieldValues, TContext
export type UseFormClearErrors<TFieldValues extends FieldValues> = (name?: FieldPath<TFieldValues> | FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]) => void;

// @public
export const useFormContext: <TFieldValues extends FieldValues = FieldValues>() => UseFormReturn<TFieldValues, any>;
export const useFormContext: <TFieldValues extends FieldValues>() => UseFormReturn<TFieldValues, any>;

// @public
export type UseFormGetFieldState<TFieldValues extends FieldValues> = <TFieldName extends FieldPath<TFieldValues>>(name: TFieldName, formState?: FormState<TFieldValues>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/useFormContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const HookFormContext = React.createContext<UseFormReturn | null>(null);
* ```
*/
export const useFormContext = <
TFieldValues extends FieldValues = FieldValues,
TFieldValues extends FieldValues,
>(): UseFormReturn<TFieldValues> =>
React.useContext(HookFormContext) as unknown as UseFormReturn<TFieldValues>;

Expand Down

0 comments on commit 4f649b5

Please sign in to comment.