React Native Stili vs CSS Stili
Styling in React Native is inspired by CSS - but it's not equivalent!
You must never forget that React Native in the end is all about translating React components (like
<Text>) to native widgets (like
widget.view - see section 1 of the course, I do dive into this there)!
These native widgets don't understand CSS. They have nothing to do with the web, HTML or anything like that!
What the React Native team does, is the following: They also provide "style translations" => CSS-inspired styling commands/ properties which also are translated to styling configurations those native widgets understand.
backgroundColor: 'black' works - it simply targets the platform-specific configurations for the native widget that will result in a black background to be drawn. Even if these native instructions look nothing like CSS. React Native does the heavy lifting behind the scenes.
<Text> doesn't support flexbox-related properties for example - but I'll dive into this later in the course.