Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

DevTool control prop does not match Control type output by `useForm`

Open
#223 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
react, typescript

Research direction

Start by locating the TypeScript declaration for DevTool described in the issue and compare its Control generic parameters with UseFormReturn. Update the declaration so TContext and TTransformedValues are preserved, then verify that a transformed Control from useForm is accepted without a typing error.

Written by the indexing model from the issue text.

Description

"@hookform/devtools": "^4.4.0"
"react-hook-form": "^7.58.0"
"@hookform/resolvers": "^5.1.1"

Problem

Currently the typing for DevTool is

export declare const DevTool: <T extends FieldValues>(props?: ({
    id?: string | undefined;
    control?: Control<T, any, T> | undefined;
} & Pick<DevtoolUIProps, "placement" | "styles">) | undefined) => JSX.Element | null;

However, the typing for Control when output by useForm is of form

export type UseFormReturn<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues> = {
    ...
    control: Control<TFieldValues, TContext, TTransformedValues>;
    ...
};

The issue is that Control<T, any, T> never ingests the TTransformedValues if set, leading to a typing error.

Proposed Solution

Change the typing for DevTool to the following:

export declare const DevTool: <TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues>(props?: ({
    id?: string | undefined;
    control?: Control<TFieldValues, TContext, TTransformedValues> | undefined;
} & Pick<DevtoolUIProps, "placement" | "styles">) | undefined) => JSX.Element | null;
Dominant language
TypeScript
Stars
670
Forks
55
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-hook-form/devtools

All issues in react-hook-form/devtools

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.