Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve type error in select component Chakra styles #2509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dwarkesh8
Copy link

fix: resolve type error in select component Chakra styles

  • Updated utils.ts to explicitly cast state.selectProps.size to Size | undefined in getValueContainerStyles and getSingleValueStyles.
  • Fixed TypeScript compatibility issues related to SizeProp and Size types.
  • Ensured proper typing for Chakra styles in the select component.

This fix addresses TypeScript errors during npx tsc --noEmit and improves type safety.

Description and Related Issue(s)

This pull request resolves TypeScript type errors in the chakra-react-select styles used in the select component. The errors were caused by an incompatible type assignment in getValueContainerStyles and getSingleValueStyles, specifically the state.selectProps.size property.

Proposed Changes

  • Updated utils.ts to explicitly cast state.selectProps.size to Size | undefined in the valueContainer and singleValue Chakra styles.
  • Ensured TypeScript compatibility and type safety by aligning with the expected Size type.
  • No changes were made to the environment variables.

Breaking or Incompatible Changes

No breaking or incompatible changes are introduced by this pull request. Existing functionality remains unchanged, and these updates only fix type-related issues.

Additional Information

These updates ensure that the project passes the npx tsc --noEmit check without errors. The changes do not affect runtime behavior but enhance code stability and developer experience by resolving type conflicts.

Checklist for PR author

  • I have tested these changes locally.

fix: resolve type error in select component Chakra styles

- Updated utils.ts to explicitly cast `state.selectProps.size` to `Size | undefined` in `getValueContainerStyles` and `getSingleValueStyles`.
- Fixed TypeScript compatibility issues related to `SizeProp` and `Size` types.
- Ensured proper typing for Chakra styles in the select component.

This fix addresses TypeScript errors during `npx tsc --noEmit` and improves type safety.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant