Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/ui/src/hooks/use-filtered-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {

const [grouped, { refetch }] = createResource(
() => {
// When items is a function (not async filter function), call it to track changes
const itemsValue =
typeof props.items === "function"
? (props.items as () => T[])() // Call synchronous function to track it
? props.items.length === 0
? (props.items as () => T[])()
: undefined
: props.items

return {
Expand Down