Styled Components
Apr 8, 2022
What are styled components ?
styled components are a CSS-in-js tool that enable writing actual code to style your components with it -whenever you define your styles , you actually create a regular React component, with your styles attached to it , it is compatible with both — React js and React Native
Getting started
installation : npm instal — save styled-components
No more need to create separate css files or using inline styling for example
We can now take compare this solution with styled components lets create a reusable title component
Another example this time using buttons :
Final example including props :