borderWidth : "transparent" , React Native Expo

39 Views Asked by At

i dont know why but for some reason when im applying border width style as "transparent" my expo app crashes immediately

<Pressable
style = {{borderWidth:"transparent"}}
>
...some components
</Pressable>

Im using react native expo and experienced this bug in android , it might not crash in an ios device i guess.

i wanted to add this style on some condition

borderWidth: lookingOptions.includes(item?.name) ? "transparent" : 0.7,

but just gave up as i thought it isnt possible , atleast in android , i dont know if its a react native bug or expo bug .

1

There are 1 best solutions below

0
Waseem Kurne On

The borderWidth property in React Native expects a numeric value representing the width of the border in logical pixels.

Please use this line for styling

borderWidth: lookingOptions.includes(item?.name) ? 0 : 0.7,

Instead of "transparent" use 0.