@fluentui/react-compose
Version:
Fluent UI React component composition.
21 lines (20 loc) • 873 B
TypeScript
/**
* Given the state and an array of slot names, will break out `slots` and `slotProps`
* collections.
*
* The root is always derived from the `as` prop.
*
* Slots will render as null if they are rendered as primitives with undefined children.
*
* The slotProps will always omit the `as` prop within them, and for slots that are string
* primitives, the props will be filtered according the the slot type. For example, if the
* slot is rendered `as: 'a'`, the props will be filtered for acceptable anchor props.
*
* @param state - State including slot definitions
* @param slotNames - Name of which props are slots
* @returns An object containing the `slots` map and `slotProps` map.
*/
export declare const getSlots: (state: Record<string, any>, slotNames?: string[] | undefined) => {
slots: Record<string, any>;
slotProps: Record<string, any>;
};