Skip to content

Commit

Permalink
Merge pull request #246 from codegouvfr/select-next-react-node
Browse files Browse the repository at this point in the history
Select-Next : option label can be a ReactNode
  • Loading branch information
garronej committed Mar 26, 2024
2 parents 4b95598 + 46d15fb commit 6292199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SelectNext.tsx
Expand Up @@ -69,7 +69,7 @@ export type SelectProps<Options extends SelectProps.Option[]> = {
export namespace SelectProps {
export type Option<T extends string = string> = {
value: T;
label: string;
label: ReactNode;
disabled?: boolean;
/** Default: false, should be used only in uncontrolled mode */
selected?: boolean;
Expand Down Expand Up @@ -160,7 +160,7 @@ function NonMemoizedNonForwardedSelect<T extends SelectProps.Option[]>(
},
...options
].map((option, index) => (
<option {...option} key={`${option.value}-${index}`}>
<option {...(option as any)} key={`${option.value}-${index}`}>
{option.label}
</option>
))}
Expand Down

0 comments on commit 6292199

Please sign in to comment.