Skip to content

Commit

Permalink
Add optional chaining for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
csandman committed Sep 19, 2024
1 parent c2fdce7 commit a271d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/use-chakra-select-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const useChakraSelectProps = <
}: Props<Option, IsMulti, Group>): Props<Option, IsMulti, Group> => {
const chakraTheme = useTheme();
const { variant: defaultVariant = "outline" } =
chakraTheme.components.Input.defaultProps;
chakraTheme?.components?.Input?.defaultProps ?? {};
const {
colorScheme: defaultTagColorScheme = "gray",
variant: defaultTagVariant = "subtle",
} = chakraTheme.components.Tag.defaultProps;
} = chakraTheme?.components?.Tag?.defaultProps ?? {};

// Combine the props passed into the component with the props that can be set
// on a surrounding form control to get the values of `isDisabled` and
Expand Down

0 comments on commit a271d18

Please sign in to comment.