-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wrap DropdownItem itemData usages with useMemo (#114)
This commit updates DropdownItem itemData usages to be wrapped inside a useMemo. Originally, I tried refactoring Dropdown to not use itemData, since itemData feels a bit like an anti pattern, however this proved to be very difficult. I also tried wrapping DropdownItem usages inside a parent component, like FilterSearchDropdownItem, however recursivelyMapChildren does not work for wrapper components that internally use DropdownItem. It only works when DropdownItem is specified as a direct child. So, as a workaround, I wrapped itemData usages inside useMemo by creating a 2d matrix of item datas, itemDataMatrix, which is then referenced by component usages. J=SLAP-2016 TEST=manual see that autocomplete options appear and can be selected see that filtersearch results appear and can be selected and applied to the search resolved all eslint warnings. yay!
- Loading branch information
Showing
3 changed files
with
39 additions
and
17 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
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