(initialState: boolean | (() => boolean) = true)
| 45 | } |
| 46 | |
| 47 | export function useSlotId2(initialState: boolean | (() => boolean) = true): SlotAria { |
| 48 | let id = useId(); |
| 49 | let [ref, hasSlot] = useSlot(initialState); |
| 50 | |
| 51 | return { |
| 52 | id: hasSlot ? id : undefined, |
| 53 | ref |
| 54 | }; |
| 55 | } |