Function: useSlot()
ts
function useSlot<D, N>(slot: N, slots: any): D[N] | undefined;Retrieves a slot from the slots object with proper typing.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
D extends Record<string, Slot> | Record<string, Slot> | The slot definitions record type |
N extends string | number | symbol | keyof D | The slot name |
Parameters
| Parameter | Type | Description |
|---|---|---|
slot | N | The slot name to retrieve |
slots | any | The slots object from the component |
Returns
D[N] | undefined
The slot function or undefined if not provided