-
Notifications
You must be signed in to change notification settings - Fork 83
border-radius
does not work with newer react-native
#192
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
Comments
border-radius
does not work with newer react-native Versionsborder-radius
does not work with newer react-native
If anyone else is running into this issue. My current workaround is to use patch-package with the following patch. diff --git a/node_modules/css-to-react-native/index.js b/node_modules/css-to-react-native/index.js
index 36200b3..5a0b42b 100644
--- a/node_modules/css-to-react-native/index.js
+++ b/node_modules/css-to-react-native/index.js
@@ -650,11 +650,6 @@ var borderColor = directionFactory({
prefix: 'border',
suffix: 'Color'
});
-var borderRadius = directionFactory({
- directions: ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'],
- prefix: 'border',
- suffix: 'Radius'
-});
var borderWidth = directionFactory({
prefix: 'border',
suffix: 'Width'
@@ -691,7 +686,6 @@ var transforms = {
background: background,
border: border,
borderColor: borderColor,
- borderRadius: borderRadius,
borderWidth: borderWidth,
boxShadow: boxShadow,
flex: flex,
diff --git a/node_modules/css-to-react-native/src/transforms/index.js b/node_modules/css-to-react-native/src/transforms/index.js
index 8474556..228f3e4 100644
--- a/node_modules/css-to-react-native/src/transforms/index.js
+++ b/node_modules/css-to-react-native/src/transforms/index.js
@@ -29,11 +29,6 @@ const borderColor = directionFactory({
prefix: 'border',
suffix: 'Color',
})
-const borderRadius = directionFactory({
- directions: ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'],
- prefix: 'border',
- suffix: 'Radius',
-})
const borderWidth = directionFactory({ prefix: 'border', suffix: 'Width' })
const margin = directionFactory({
types: [LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT, AUTO],
@@ -56,7 +51,6 @@ export default {
background,
border,
borderColor,
- borderRadius,
borderWidth,
boxShadow,
flex,
best regards |
You can filter out properties from the transform https://github.com/styled-components/css-to-react-native?tab=readme-ov-file#api |
@jacobp100 What if I'm using styled components, is there a way to config this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey folks,
first of all thank you for your great work! 👍
In the current react-native releases (0.73.6 at the time of writing) there is an issue with translating
border-radius
. It generates theborderTopLeftRadius
,borderTopRightRadius
, etc. style properties. This does not work for Image and Text anymore.Maybe its better to translate the border-radius css without a directionFactory and let the user decide how he want's to specify the attributes?
so instead of writing
I could just do, if I wanted
The text was updated successfully, but these errors were encountered: