0 votes
in ReactJS by
Styling in React Native Example

1 Answer

0 votes
by
Styling in React Native

React Native borrows many ideas of styling for the Web. For example, in CSS, you write the following:

.container { 
   background-color: #222222; 
}

However, in React Native, you would write the following in JavaScript:

const styles = StyleSheet.create({ 
   container: { 
      backgroundColor: '#222222' 
   } 
}); 

By writing CSS in JavaScript, you are isolating stylesfrom global namespace.

Related questions

0 votes
asked May 29, 2020 in ReactJS by anonymous
0 votes
asked May 20, 2020 in ReactJS by GeorgeBell
...