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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶issue: Controlled component is broken (TS-only) with TTransformedValues generic value being used #11508

Closed
1 task done
xsjcTony opened this issue Feb 14, 2024 · 4 comments
Labels
regression Regression with code change

Comments

@xsjcTony
Copy link

xsjcTony commented Feb 14, 2024

Version Number

7.50.1

Codesandbox/Expo snack

https://stackblitz.com/edit/vitejs-vite-zu9h3d?file=src%2Fcomponents%2FControlledInput.tsx,src%2FApp.tsx&terminal=dev

Steps to reproduce

  1. Go to 'App.tsx'
  2. See error

Expected behaviour

It should not error.

First of all, I appreciate all your hard work馃挌
This seems a regression in #11420 @bluebill1049

I've been using this controlled component pattern for ages, everything works smoothly before 7.50.1, but breaks after.

I've provided a minimal reproduction of 2 react-hook-form versions below:

Comparison:
v7.50.1: https://stackblitz.com/edit/vitejs-vite-zu9h3d?file=src%2Fcomponents%2FControlledInput.tsx,src%2FApp.tsx&terminal=dev
v7.49.3: https://stackblitz.com/edit/vitejs-vite-ym12kg?file=src%2FApp.tsx,package.json&terminal=dev

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added the regression Regression with code change label Feb 14, 2024
@xsjcTony
Copy link
Author

https://github.com/react-hook-form/react-hook-form/pull/11420/files#r1460438108 This looks a bit weird to me, I don't find any benefits of adding the third generic to the Control type.
Maybe I'm missing something since I don't have much insight into this. I'll temporarily ping the version to v7.49.3 to resolve the issue.
Cheers!

@bluebill1049
Copy link
Member

I may just revert that original PR fix for now.

@bluebill1049
Copy link
Member

reverted for now, will release in the next patch.

@mlabrum

This comment was marked as spam.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Regression with code change
Projects
None yet
Development

No branches or pull requests

3 participants