createComponent

export function createComponent<T extends keyof MappedComponentTypes>(
data: APIMessageComponent & { type: T },
): MappedComponentTypes[T];
export function createComponent<T extends keyof MappedComponentTypes>(
data: APIMessageComponent & { type: T },
): MappedComponentTypes[T];
Transforms API data into a component
NameConstraintsOptionalDefaultDescription
Tkeyof MappedComponentTypesNoNone
NameTypeOptionalDescription
dataAPIMessageComponent & { type: T }NoThe data to create the component from