-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: separate useControlledState hook #1267
feat: separate useControlledState hook #1267
Conversation
Co-authored-by: Alexandr Isaev <[email protected]>
6638803
to
788c002
Compare
Preview is ready. |
also here I think it's a simple hook that will be regularly used while developing library components |
const [state, setState] = React.useState(value ?? defaultValue); | ||
|
||
return [ | ||
value || state, |
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.
value ?? state
@IsaevAlexandr @amje @korvin89 Ping |
@IsaevAlexandr Hey! We already have this one. Could we use your hook instead of date-components hook? |
@IsaevAlexandr @korvin89 Seems the same functionality is implemented in #1276 |
This functionality have added here #1276 |
@GermanVor related to #1090 (comment).
I'm not sure if this functionality is needed or not. I make this proposal to discuss