Answer the question
In order to leave comments, you need to log in
How to set styles for a class in styled components?
How to set styles for a class in styled components?
I want to style the swiper wrapper using the .heroSlider class, how can I do this without creating a component in styled components?
<Swiper
wrapperTag='ul'
className='heroSlider'
allowTouchMove={false}
speed={600}
>
...
</Swiper>
Answer the question
In order to leave comments, you need to log in
It all depends on what Swiper renders.
Well, or you can try to "throw" classes on the component:
const StyledSwiper = styled(Swiper)`
// содержимое .heroSlider
`;
render(
<StyledSwiper
wrapperTag='ul'
allowTouchMove={false}
speed={600}
>
...
</Swiper>
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question