-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
[core] Narrow type definition for useControlled hook #21027
[core] Narrow type definition for useControlled hook #21027
Conversation
- Add missing `newValue` parameter to set function returned by the useControlled hook. - Made the UseControlledProps interface generic along with the hook itself. - This way, the returned value can be correctly typed. - A default type of `any` was given to make the type change non-breaking. - Added missing `state` property to the UseControlledProps interface.
Details of bundle changes.Comparing: e25b7d5...2957ff3 Details of page changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'd like to remove the any
before merge though.
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
…ed hook Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
I always forget about the Thanks for the speedy review; the requested changes have been made. |
@EdwardSalter Much appreciated, thanks! |
newValue
parameter to set function returned by the useControlled hook.any
was given to make the type change non-breaking.state
property to the UseControlledProps interface.