Issue
How to define margin/padding shorthand in React Native?
margin: 10px 20px;
Solution
When using plain React Native styles you can rewrite your css above to
{ marginVertical: 10, marginHorizontal: 20 }
Otherwise the above syntax can be achieved if you're using something like styled-components, which uses css-to-react-native under the hood.
Answered By - rk1
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.