Skip to content

Commit

Permalink
Set default value for type parameter in SelectProps (#7014)
Browse files Browse the repository at this point in the history
Co-authored-by: Reid Barber <[email protected]>
  • Loading branch information
kp047i and reidbarber authored Oct 16, 2024
1 parent 9152d83 commit e1b72a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-aria-components/src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export interface SelectRenderProps {
isRequired: boolean
}

export interface SelectProps<T extends object> extends Omit<AriaSelectProps<T>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, SlotProps {}
export interface SelectProps<T extends object = {}> extends Omit<AriaSelectProps<T>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, SlotProps {}

export const SelectContext = createContext<ContextValue<SelectProps<any>, HTMLDivElement>>(null);
export const SelectStateContext = createContext<SelectState<unknown> | null>(null);

function Select<T extends object>(props: SelectProps<T>, ref: ForwardedRef<HTMLDivElement>) {
function Select<T extends object = {}>(props: SelectProps<T>, ref: ForwardedRef<HTMLDivElement>) {
[props, ref] = useContextProps(props, ref, SelectContext);
let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;
let content = useMemo(() => (
Expand Down

1 comment on commit e1b72a7

@rspbot
Copy link

@rspbot rspbot commented on e1b72a7 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.