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

issue: typings broke / changed in non-major version #9684

Closed
1 task done
iway1 opened this issue Dec 30, 2022 · 0 comments
Closed
1 task done

issue: typings broke / changed in non-major version #9684

iway1 opened this issue Dec 30, 2022 · 0 comments
Labels
status: under investigation aware of this issue and pending for investigation TS Typescript related issues

Comments

@iway1
Copy link

iway1 commented Dec 30, 2022

Version Number

7.41.2

Codesandbox/Expo snack

https://codesandbox.io/s/inspiring-spence-w5zx16?file=/src/App.tsx

Steps to reproduce

Step 1 - View the code below

import { Control, FieldValues, Path, useController, useForm } from "react-hook-form";

export function Form<Schema extends FieldValues>({
  control,
  name,
} : {
  control: Control<Schema>,
  name: Path<Schema>
}) {
  const f = useController({
    name,
    control,
  })
}

Step 2 -
Observe type error

Expected behaviour

Shouldn't throw a type error, it used to not throw a type error and allow inferred typesafe completion of names when passing the prop to the form. This is a breaking change. Here's the type error:

Screenshot 2022-12-30 at 8 17 35 AM

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added status: under investigation aware of this issue and pending for investigation TS Typescript related issues labels Dec 30, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: under investigation aware of this issue and pending for investigation TS Typescript related issues
Projects
None yet
Development

No branches or pull requests

2 participants