Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4842ca7

Browse files
committedJan 22, 2025··
fix type error
1 parent 1bf3e1c commit 4842ca7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed
 

‎packages/components/src/components/Select/Combobox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type ComboboxProps = {
2222
/**
2323
* The active value in the combobox component. This is used to control the combobox externally.
2424
*/
25-
value?: string;
25+
value?: string | null;
2626
/**
2727
* The default value of the combobox component. Used for uncontrolled usages.
2828
*/

‎packages/components/src/components/Select/Select.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const ExternallyControlled: Story = {
240240
},
241241
],
242242
render: (args) => {
243-
const [activeItem, setActiveItem] = useState<string>();
243+
const [activeItem, setActiveItem] = useState<string | null>();
244244
return (
245245
<>
246246
<Select

‎packages/components/src/components/Select/Select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type SelectComponentProps = {
2525
/**
2626
* The active value in the select component. This is used to control the select externally.
2727
*/
28-
value?: string;
28+
value?: string | null;
2929
/**
3030
* The default value of the select component. Used for uncontrolled usages.
3131
*/

‎packages/components/src/components/Select/useSelectData.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const useSelectData = (children: ReactNode) => {
9393
);
9494

9595
const getItemByValue = useCallback(
96-
(value?: string) => (value ? itemValues.find((item) => item.value === value) : undefined),
96+
(value?: string | null) => (value ? itemValues.find((item) => item.value === value) : undefined),
9797
[itemValues],
9898
);
9999

0 commit comments

Comments
 (0)
Please sign in to comment.