react-nativeflexboxbox-sizing

Does it exist an equivalent of box-sizing: border-box in flexbox for React Native?


I would like the size of my boxes not to be changed by margin and padding.


Solution

  • React Native styles all views as if box-sizing: border-box is set. See this code: https://github.com/facebook/react-native/blob/5aa1fb3ff326a429e33a443576da866f2a63c20c/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java#L632