Issue
When styling a React Native app with Styled Components 5.x I'm getting the warning...
Expected style "borderWidth: 2" to contain units.
href="https://i.stack.imgur.com/Hiowm.png" rel="noreferrer">
This didn't happen with previous versions.
What does the warning mean?
Solution
After some research and questions on github I tracked this one down...
Styled Components uses the package css-to-react-native for it's React Native conversions.
css-to-react-native recently released version 3 which now requires units to be present for all measurements. Details here.
You should use px
for React Native as it is density independent.
Answered By - GollyJer
Answer Checked By - - Pedro (ReactFix Volunteer)