D
D
Daria Shashko2018-09-27 23:40:56
css
Daria Shashko, 2018-09-27 23:40:56

What is the best styling approach for Reat-native?

Application in React Native. At the moment we are using css-in-js and we create a separate file with styles under each component. Those. each component in its folder has an index file with logic and markup and a file with styles.
There was an attempt to create something so basic. Those. in assets at the level of the folder with components there is a folder with styles and there are several files: button, container, spacer. And I wanted to somehow use it all in a smart way, but this did not solve the problem, that in addition to our folder with styles, each component also has something basic to import from button, container. Didn't like the approach. turned out to be large footcloths of arrays with styles.
Can a styled component solve this problem? What can you advise? Maybe some convenient approach? Or is styled component my destiny? Help with advice on how to improve the readability of the code and make it look like "candy".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2018-09-28
@grinat

In the case of react native, throw it in the trash and write native code in java and swift. This will immediately solve absolutely all problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question