-
Notifications
You must be signed in to change notification settings - Fork 45
[CLNP-6724] fix: allow string values for borderRadius in StyleSheet #240
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #240 +/- ##
========================================
Coverage 11.49% 11.49%
========================================
Files 358 358
Lines 8489 8489
Branches 2375 2257 -118
========================================
Hits 976 976
Misses 7512 7512
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the type definition for borderRadius in the StyleSheet to allow string values, reflecting changes in React Native 0.75. The changes include:
- Updating the parameter and return types for DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE.
- Adding a //@ts-ignore directive for the 'borderRadius' property.
- Ensuring compatibility across supported React Native versions.
| const preProcessor: Partial<StylePreprocessor> = { | ||
| 'fontSize': DEFAULT_SCALE_FACTOR, | ||
| 'lineHeight': DEFAULT_SCALE_FACTOR, | ||
| //@ts-ignore |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider adding an explanatory comment alongside //@ts-ignore to clarify the specific React Native compatibility issue being addressed.
| //@ts-ignore | |
| // @ts-ignore: React Native's type definitions do not fully align with the expected type for 'borderRadius'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates the borderRadius type in StyleSheet to support string values, following the change in React Native 0.75.
- Updated DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE to accept both numeric and string types.
- Added a //@ts-ignore comment for the borderRadius preprocessor to support all active React Native versions.
Comments suppressed due to low confidence (1)
packages/uikit-react-native-foundation/src/styles/createStyleSheet.ts:15
- [nitpick] Since the function now supports string values, consider renaming DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE to better reflect its functionality, for example, DEFAULT_SCALE_FACTOR_WITH_NUMERIC_OR_STRING_VALUE.
const DEFAULT_SCALE_FACTOR_WITH_NUMERIC_VALUE = (
| const preProcessor: Partial<StylePreprocessor> = { | ||
| 'fontSize': DEFAULT_SCALE_FACTOR, | ||
| 'lineHeight': DEFAULT_SCALE_FACTOR, | ||
| //@ts-ignore : Ensure compatibility with all supported React Native versions |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider expanding the @ts-ignore comment to reference the relevant React Native version or commit for clarity and future maintainability.
| //@ts-ignore : Ensure compatibility with all supported React Native versions | |
| //@ts-ignore: Required for compatibility with React Native version >=0.65 due to changes in StyleSheet types. See https://github.com/facebook/react-native/commit/<commit-hash>. |
External Contributions
This project is not yet set up to accept pull requests from external contributors.
If you have a pull request that you believe should be accepted, please contact
the Developer Relations team [email protected] with details
and we'll evaluate if we can setup a CLA to allow for the contribution.
For Internal Contributors
[CLNP-6724](https://sendbird.atlassian.net/browse/CLNP-6724)
Description Of Changes
The borderRadius type in StyleSheet was updated to support string values in React Native 0.75.
To reflect this change, the parameter and return types were updated from
NonNullable<AnimatableNumericValue | undefined> to
NonNullable<AnimatableNumericValue | string | undefined>.
Additionally, // @ts-ignore was added to ensure compatibility with all supported React Native versions.
Types Of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that apply_