Search code examples
javascriptcssreactjsionic-frameworkstyled-components

Is styled-components good for ionic framework?


I have question about the correctness of using styled components or another type of css styling in react

I prefer to use styled components in my projects. I agree that ionic components have many functionality out the box that help me work with native platform correctly

but for example ion-text is useless for me because it havent got support for font-size, font-weight in variables.css

so I prefer to create my custom TextComponent by styled components lib.

and there are many cases in my project when comfortable for me to use styled-components instead ionic components

so... the question

does use styled-components effect on my project? Are there some problems of using styled-components instead ionic components

or it will do no effects on my projects and there is no reason to use only ionic components for my UI?


Solution

  • There is no such specifications to use ionic tags only, as you mentioned ion-text. Mostly ionic components are pre-styled to fit /adjust itself in mobile view as well. If anyone uses custom styled components/tags considering mobile view and functionality in concern, it don't affect your mobile view. Just use relative parameters like %, rem etc for designing, it helps in maintaining the view for mobile.

    So conclusion is, you can use custom components,it will not affect your project.