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

Property 'slidesEl', 'slidesGrid', 'slidesSizesGrid' does not exist on type 'Swiper' #7767

Closed
6 tasks done
davindev opened this issue Oct 15, 2024 · 1 comment
Closed
6 tasks done
Labels

Comments

@davindev
Copy link
Contributor

davindev commented Oct 15, 2024

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/property-slidesel-slidesgrid-slidessizesgrid-does-not-exist-on-type-swiper-vckw95

Bug description

I am using Swiper in a React + TypeScript environment.
To access the properties of the Swiper instance, I am importing the type as shown below:

import { Swiper as SwiperType } from 'swiper';

While using various properties of the instance, I encountered the following type errors:

Property 'slidesEl' does not exist on type 'Swiper'.ts(2339)
Property 'slidesGrid' does not exist on type 'Swiper'.ts(2339)
Property 'slidesSizesGrid' does not exist on type 'Swiper'.ts(2339)

When checking the instance using console.log(), I was able to confirm that these values are present.
However, it seems that these types are missing from the Swiper type definitions.

(There is a similar issue here, but since type errors are also occurring with the slidesEl and slidesSizesGrid properties in addition to slidesGrid, I have created a new issue.)

Expected Behavior

The properties slidesEl, slidesGrid, and slidesSizesGrid are displayed as part of the Swiper interface.

Actual Behavior

When accessing the slidesEl, slidesGrid, and slidesSizesGrid properties, the following type errors occur:

Property 'slidesEl' does not exist on type 'Swiper'.ts(2339)
Property 'slidesGrid' does not exist on type 'Swiper'.ts(2339)
Property 'slidesSizesGrid' does not exist on type 'Swiper'.ts(2339)

Swiper version

11.1.4

Platform/Target and Browser Versions

All

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
@nolimits4web
Copy link
Owner

fixed in #7768

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

2 participants