fix(ui): use curried defineComponent for type safety

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-01-12 12:11:01 +01:00
parent 1bf6060efb
commit beda906825
2 changed files with 7 additions and 4 deletions
@@ -15,13 +15,17 @@
*/
import { defineComponent } from '../../hooks/useDefinition';
import type { ButtonOwnProps } from './types';
import styles from './Button.module.css';
/**
* Component definition for Button
* @public
*/
export const ButtonDefinition = defineComponent({
export const ButtonDefinition = defineComponent<
ButtonOwnProps,
typeof styles
>()({
styles,
classNames: {
root: 'bui-Button',
@@ -19,7 +19,6 @@ import type { ComponentConfig } from './types';
export function defineComponent<
P extends Record<string, any>,
S extends Record<string, string>,
const C extends ComponentConfig<P, S>,
>(config: C): C {
return config;
>() {
return <const C extends ComponentConfig<P, S>>(config: C): C => config;
}