Is there an way to use custom Swiper Component in React (using Typescript)? #4711
Unanswered
hayoung-jeremy
asked this question in
Q&A
Replies: 1 comment
-
this could be the answer for me : #4291 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
6.7.0
7.17.0
What You Did
I wanted to make a custom Swiper Template, so that I can re-use it whenever the contents change.
and this is my folder structure (simplified) :
bannerImages.json
is an array containing objects which have information of the images inpublic
folder :my
SwiperTemplate.tsx
looks like :and I use it in my
HomeContainer
:as you can see above, when I import
Swiper
directly in myHomeContainer
, it shows my whole images perfectly, and Swiper works too, but when I import my customSwiperTemplate
, it only shows two images, and Swiper doesn't work(I can't swipe the banner, navigation and pagination does not work either)this is how it looks
// first one is the case when I directly import
Swiper
// second one is the case when I use my custom
SwiperTemplate
here is my github : https://github.com/hayoung-jeremy/nature-republic/commit/4cf5697255b6d14e8328813ad9512cda62b5c37e
What am I doing wrong?
Expected Behavior
I want my images rendered
and swiping action works
Actual Behavior
It only renders one or two images,
and swiper doesn't work
Beta Was this translation helpful? Give feedback.
All reactions