Skip to content

Commit

Permalink
fix add back default value
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed Jan 23, 2024
1 parent 21b652c commit 3818e11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hooks/use-filtered-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const fuzzy = new uFuzzy();
* @param {string?} property name of the prop
* @returns {Array} filtered list
*/
export function useFilteredList<TListItem extends {[key: string]: string}>(list: TListItem[] = [], searchTerm = '', property: keyof TListItem) {
export function useFilteredList<TListItem extends {[key: string]: string}>(list: TListItem[] = [], searchTerm = '', property: keyof TListItem = 'name') {
const [filteredList, setFilteredList] = useState(list);

const propertyList = useMemo(() => list.map((item) => item[property]), [list, property]);
Expand Down

0 comments on commit 3818e11

Please sign in to comment.