-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: default selected value and custom text with useSelect (#681)
BREAKING CHANGE: useSelect now takes `itemTextKey` or `getItemText` prop to choose what text should be rendered in a Select option * feat: improve useSelect hook - It accepts a 'defaultSelectedItem' property. - You can specify which object serves as the label in two ways: - Using the 'itemLabelKey' property, which accepts only keys where the value type is string. - Using the 'itemLabelMap' function, which takes an item as a parameter and returns a string. * refactor: select storties * refactor: select properties - rename 'itemLabelKey' to 'itemTextKey' - rename 'itemLabelMap' to 'getItemText'
- Loading branch information
1 parent
ca1af0e
commit c9125c8
Showing
2 changed files
with
110 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters