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

Setting className on SwiperSlide triggers runtime error with React 18 in strict mode #5656

Closed
5 of 6 tasks
raphaelsaunier opened this issue Apr 22, 2022 · 0 comments
Closed
5 of 6 tasks
Labels

Comments

@raphaelsaunier
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/practical-ganguly-w39dul?file=/pages/index.tsx

Bug description

Duplicate of #5613 and possibly related to #5398

Expected Behavior

I should be able to set a className on <SwiperSlide> components.

Actual Behavior

Setting a className triggers the following error, initially reported in #5613:

  • Chrome: TypeError: Cannot read properties of undefined (reading 'slideClass')
  • Safari: TypeError: undefined is not an object (evaluating 'swiper.params.slideClass')
  • Firefox: TypeError: can't access property "slideClass", swiper.params is undefined

Swiper version

8.1.3

Platform/Target and Browser Versions

All browsers are affected

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
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