-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[RFR] Introduce useChoices & useSuggestions hook #3683
Conversation
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.
Great idea! Looking forward to the full refactoring (hope there will be more red than green).
translateChoice: boolean; | ||
} | ||
|
||
const useChoices = ({ optionText, optionValue, translateChoice }) => { |
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.
shouldn't it be singular, useChoice
?
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.
Not sure yet
It probably won't as I'll keep the existing redundant tests and add almost the same on the new hooks |
This PR aims at uniforming choices handling in all components which accept choices.
It provides helper functions to get a choice value and text.
It might have breaking changes for the AutocompleteArrayInput and AutocompleteInput components
Fixes #3630, #2961, #3418, #3098