Skip to content

Commit 04db275

Browse files
committed
chore: update
1 parent 27e7b2c commit 04db275

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/hooks/useComponents.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import SelectInput, { type SelectInputProps } from '../SelectInput';
33

44
export interface ComponentsConfig {
55
root?: React.ComponentType<any>;
6+
input?: React.ComponentType<any>;
67
}
78

89
export interface ReturnType {
9-
root: React.ComponentType<SelectInputProps>;
10+
root: React.ComponentType<SelectInputProps> | string;
11+
input: React.ComponentType<any> | string;
1012
}
1113

1214
export default function useComponents(components?: ComponentsConfig): ReturnType {
1315
return React.useMemo(() => {
14-
const { root: RootComponent = SelectInput } = components || {};
16+
const { root: RootComponent = SelectInput, input: InputComponent = 'input' } = components || {};
1517

16-
return { root: RootComponent };
18+
return { root: RootComponent, input: InputComponent };
1719
}, [components]);
1820
}

0 commit comments

Comments
 (0)