Skip to content
Advertisement

Tag: styled-components

Toggle style by clicking on button using styled-component

After onClick, it starts function onToggleLiked in app.js which toggle like property and return(or not) like to item.js. After that, AppListItem check if like has appeared, and use styles from const theme if the result is true, else – from defaultProps. How to do that? I’ve tried to create a function, but failed. Answer You can simply spread the desired

use tailwind classes into styled-components

Can I use tailwind classes ( like colors ) into the styled-components ? I want to use some classes instead of CSS styles to style my components this is the way add class in styled-components: so unlike styles, attrs className is only one single string, and I want to add classes for size, color, display and etc. I have to

Advertisement