How to use CSS in ReactNative

Can I use CSS to style my ReactNative . Currently I can use StyleSheet like this:

var styles = React.StyleSheet.create({
 autocomplete: {
   backgroundColor: '#FFF',
   zIndex: 5,
 },
 ...

      

I want to use CSS instead like in ReactJs

+3


source to share


3 answers


What does pure css mean ?

Have a look at styled-components , the project is under active development.



This allows you to build your reactive components using css.

0


source


I had the same problem and solved it using this component. I see it is not being developed anymore, but it works great for me.



It basically takes your CSS files and generates some StyleSheet components from them that you can easily integrate into your responsive application.

0


source


Try this library: https://atom.io/packages/atom-react-native-css

You can style components with CSS and inline SASS support.

0


source







All Articles