I'm learning TypeScript but today i see a few lines of code like this :
const ROOT: ViewStyle = { alignItems: 'center', backgroundColor: color.primary, borderRadius: 8, flex: 1, justifyContent: 'center', marginHorizontal: spacing[2], marginTop: spacing[2], paddingHorizontal: spacing[4], height: "100%",}
First of all, What is ViewStyle??
I searched google for this but feel like it not have documentation for this, the offical document for this only have stye
for View
component, so what is ViewStyle, and TextStyle also?
And i don't understand why they don't use marginHorizontal: 2
instead of marginHorizontal: spacing[2]
, spacing[2] to create space?? But why use that when we can directly choose number for marginHorizontal
and why we have array in here??
Please help, thank you a lots