TanStack Router and Swiper JS strange styling behavior #4068
Unanswered
TomoFromEarth
asked this question in
Q&A
Replies: 1 comment
-
can you please provide this as a complete minimal example? |
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
-
I have recently migrated (or am in the process of migrating) from React Router to TanStack router and everything is mostly going just fine. On my home page I have several carousels using the Swiper JS library with some specific styling for sizes and shape of the individual Swiper elements which were working as expected with React Router. When I switched to TS router for some reason the styling of these individual Swiper elements were no longer being respected, even though in dev tools elements tab it shows that the styles are in fact being applied.
Another thing to note is that this is only happening with one of the Swiper modules, I am using a different module on another page and it is working as expected. I have created separate routes away from the index route where my home page component is being rendered and used this Swiper component to see if this was just something with the index route and it still does the same thing.
The thing that is very confusing is that the styles are being applied when running the app in prod but they just aren't actually rendering. I have to be honest I don't really know where to even begin with this since there are no meaningful errors and I feel that it is a skill issue on my part so any help would be truly appreciated. I am happy to provide code snippets and/or screenshots of the way it should look vs. what it looks like now in case that would help anyone.
This is the code for the actual Swiper carousel
This is how the component is being used in Home.tsx
The rest of the TanStack Router code is pretty much standard boilerplate as the routes aren't actually that complex, We only have a few for now but I am happy to share any of that code as well if someone would like to see it. I appreciate any and all help/guidance...
Beta Was this translation helpful? Give feedback.
All reactions