You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set loading='lazy' to image element inside SwiperSlide and set React.StrictMode you will see error message
Uncaught TypeError: Cannot read properties of undefined (reading 'slideClass')
at slideSelector (process-lazy-preloader.js:2:1)
at processLazyPreloader (process-lazy-preloader.js:3:1)
at HTMLImageElement.<anonymous> (core.js:484:1)
I know that lazy loading reimplemented in Swiper 9.
Is it possible to avoid execution of processLazyPreloader if developer don't want to use preloader spinners?
Expected Behavior
Native lazy loading working without issues in console in React.StrictMode
Actual Behavior
Errors in console:
Uncaught TypeError: Cannot read properties of undefined (reading 'slideClass')
at slideSelector (process-lazy-preloader.js:2:1)
at processLazyPreloader (process-lazy-preloader.js:3:1)
at HTMLImageElement.<anonymous> (core.js:484:1)
Check that this is really a bug
Reproduction link
https://codesandbox.io/s/swiper-9-react-strict-issue-c83d98
Bug description
Swiper 9.0.2 + React 18.2.0 in
StrictMode
If you set
loading='lazy'
to image element insideSwiperSlide
and setReact.StrictMode
you will see error messageswiper/src/shared/process-lazy-preloader.js
Line 2 in 9fe9a96
I know that lazy loading reimplemented in Swiper 9.
Is it possible to avoid execution of
processLazyPreloader
if developer don't want to use preloader spinners?Expected Behavior
Native lazy loading working without issues in console in
React.StrictMode
Actual Behavior
Errors in console:
Swiper version
9.0.2
Platform/Target and Browser Versions
Win/Mac, Chrome
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: