Answer the question
In order to leave comments, you need to log in
How to style React + StyledComponents pseudo-element?
There is an ArticleInfo component:
const ArticleInfo = ({key, name, url, text}) => (
<Article key = {key}>
<h3>{name}</h3>
<p>{text}</p>
</Article>
)
{features.map(item => ArticleInfo(item))}
background: url(${url})
Answer the question
In order to leave comments, you need to log in
const Article = styled.div`
&:before {
background-image: url(${props => props.beforeImage});
}
&:after {
background-image: url(${props => props.afterImage});
}
`;
<Article beforeImage={beforeImage} afterImage={afterImage}>
{/* ... */}
</Article>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question