Move contexts over to useXContext model

Fixes #4
This commit is contained in:
Ryan Gossiaux
2021-12-15 10:13:01 -08:00
parent f1edb17609
commit dbfb2c227e
12 changed files with 85 additions and 31 deletions

View File

@@ -1,8 +1,8 @@
<script lang="ts">
import { getContext } from "svelte";
import { ListboxStates, StateDefinition } from "./Listbox.svelte";
import { ListboxStates, useListboxContext } from "./Listbox.svelte";
import { useId } from "$lib/hooks/use-id";
let api: SvelteStore<StateDefinition> = getContext("api");
let api = useListboxContext("ListboxLabel");
let id = `headlessui-listbox-label-${useId()}`;
let labelStore: SvelteStore<HTMLLabelElement> = getContext("labelStore");