fix: clear the last type errors
asChild is a bits-ui v1 prop the icon picker no longer needs -- it already passes a child snippet. The drop zone set both webkitdirectory and a bare directory attribute, which no browser implements. The library view seeds its collection state once by design, so it says so with untrack.
This commit is contained in:
@@ -185,7 +185,6 @@
|
|||||||
type="file"
|
type="file"
|
||||||
onchange={change}
|
onchange={change}
|
||||||
webkitdirectory={directory}
|
webkitdirectory={directory}
|
||||||
{directory}
|
|
||||||
class="hidden"
|
class="hidden"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Popover.Root bind:open>
|
<Popover.Root bind:open>
|
||||||
<Popover.Trigger asChild>
|
<Popover.Trigger>
|
||||||
{#snippet child({ props })}
|
{#snippet child({ props })}
|
||||||
<Button variant="outline" size="icon" class="h-9 w-9" {...props}>
|
<Button variant="outline" size="icon" class="h-9 w-9" {...props}>
|
||||||
<SelectedIconComponent class="size-4" />
|
<SelectedIconComponent class="size-4" />
|
||||||
|
|||||||
@@ -20,7 +20,13 @@
|
|||||||
};
|
};
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
const { books, ...filterData } = data;
|
// Seeds the collection state once, deliberately: it owns the list from here on, and the
|
||||||
|
// effect below feeds it later navigations. untrack says so, rather than reading props
|
||||||
|
// outside a closure and being warned about capturing only the initial value.
|
||||||
|
const { books, filterData } = untrack(() => {
|
||||||
|
const { books: initialBooks, ...rest } = data;
|
||||||
|
return { books: initialBooks, filterData: rest };
|
||||||
|
});
|
||||||
|
|
||||||
const bookOps = getBookOperationsState();
|
const bookOps = getBookOperationsState();
|
||||||
const bookCollection = setBookCollectionState(bookOps, books, filterData);
|
const bookCollection = setBookCollectionState(bookOps, books, filterData);
|
||||||
|
|||||||
Reference in New Issue
Block a user