Skip to content

Commit 6292199

Browse files
authored
Merge pull request #246 from codegouvfr/select-next-react-node
Select-Next : option label can be a ReactNode
2 parents 4b95598 + 46d15fb commit 6292199

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SelectNext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export type SelectProps<Options extends SelectProps.Option[]> = {
6969
export namespace SelectProps {
7070
export type Option<T extends string = string> = {
7171
value: T;
72-
label: string;
72+
label: ReactNode;
7373
disabled?: boolean;
7474
/** Default: false, should be used only in uncontrolled mode */
7575
selected?: boolean;
@@ -160,7 +160,7 @@ function NonMemoizedNonForwardedSelect<T extends SelectProps.Option[]>(
160160
},
161161
...options
162162
].map((option, index) => (
163-
<option {...option} key={`${option.value}-${index}`}>
163+
<option {...(option as any)} key={`${option.value}-${index}`}>
164164
{option.label}
165165
</option>
166166
))}

0 commit comments

Comments
 (0)