Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy loading doesn't work correctly with React 18 + Strict Mode + Swiper 8 #5737

Closed
5 of 6 tasks
patcheco1001 opened this issue May 22, 2022 · 0 comments
Closed
5 of 6 tasks
Labels

Comments

@patcheco1001
Copy link

patcheco1001 commented May 22, 2022

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/zealous-shannon-opxyp2?file=/src/index.js

Bug description

I read issue 5398 on React 18 + Strict Mode. Thank you for your correction in version 8.0.0
But if I use the <React.StrictMode> and have more than one image to lazy load, only the first image is displayed.
As you can see in my code the background is displayed correctly but not the poster image on the right.
Note: sometimes the background is not displayed either

Expected Behavior

Same as when <React.StrictMode> is not used

Actual Behavior

When I open the network panel, the poster is loaded but not displayed.
Capture d’écran 2022-05-22 172750

And the data-src attribute was not replaced by src
Capture d’écran 2022-05-22 172830

Swiper version

8.1.5

Platform/Target and Browser Versions

Chrome

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@patcheco1001 patcheco1001 changed the title Lazy loading doesn't work with React 18 Strict Mode Lazy loading doesn't work correctly with React 18 + Strict Mode + Swiper 8 May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant