mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 23:54:53 +00:00
fix: do not crash when borderRadius is set on Android (#2415)
# Summary Fixes #2462 Currently, on Android, when `borderRadius` style is applied to a `Svg` component an error occurs, stating `Cannot cast Double to Float` This PR updates the codegen types, changing them from Double to Dynamic, aligning with the implementation with the ViewProps. ## Test ### Tested on - [x] react-native@0.76.0-rc.1 - [x] react-native@0.75.1 - [x] react-native@0.74.2 - [x] react-native@0.73.9 ### Test case ```jsx <Svg width="60" height="60" viewBox="0 0 24 24" style={{ borderRadius: 16.2, borderTopLeftRadius: 16.2, borderBottomRightRadius: 16.2, borderStartStartRadius: 16.2, borderStartEndRadius: 16.2, borderTopRightRadius: 16.2, borderBottomLeftRadius: 16.2, borderTopStartRadius: 16.2, borderTopEndRadius: 16.2, borderBottomStartRadius: 16.2, borderBottomEndRadius: 16.2, borderEndEndRadius: 16.2, borderEndStartRadius: 16.2, }}> <Rect x="0" y="0" width="24" height="24" fill="red" /> </Svg> ``` ## Compatibility | OS | Implemented | | ------- | :---------: | | Android | ✅ |
This commit is contained in:
@@ -118,7 +118,9 @@ android {
|
||||
"src/paper/java",
|
||||
]
|
||||
}
|
||||
if (getReactNativeMinorVersion() >= 73) {
|
||||
if (getReactNativeMinorVersion() >= 75) {
|
||||
srcDirs += "src/borderRadiusRn75/java"
|
||||
} else if (getReactNativeMinorVersion() >= 73) {
|
||||
srcDirs += "src/transformRn73/java"
|
||||
} else {
|
||||
srcDirs += "src/deprecated/java"
|
||||
|
||||
Reference in New Issue
Block a user