fix(ui): use curried defineComponent for type safety
Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user