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 'AutoScroll' of type 'AutoScrollComponent | undefined' is not assignable to string index type 'BaseComponent' #5

Closed
2 tasks done
davidpawar opened this issue Apr 20, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@davidpawar
Copy link

Checks

Version

v0.4.2

Description

According to the documentation, I have added the AutoScroll extension.

import { Splide } from '@splidejs/splide';
import { AutoScroll } from '@splidejs/splide-extension-auto-scroll';

new Splide( '.splide' ).mount( { AutoScroll } );

After importing AutoScroll the build fails:

Property 'AutoScroll' of type 'AutoScrollComponent | undefined' is not assignable to 'string' index type 'BaseComponent'.

Is that happening only for me?

Reproduction Link

No response

Steps to Reproduce

  1. Follow the documentation to use AutoScroll https://splidejs.com/extensions/auto-scroll/
  2. Start the project :-)

Expected Behaviour

No build error.

@davidpawar davidpawar added the bug Something isn't working label Apr 20, 2022
@davidpawar
Copy link
Author

davidpawar commented Apr 20, 2022

Changing the interface inside AutoScroll.ts to:

    interface Components {
        AutoScroll: AutoScrollComponent;
    }

worked for me. (removed that AutoScroll is optional) Not sure if that's a suitable solution here.

@NaotoshiFujita
Copy link
Contributor

I've checked it but haven't seen any error:
https://codesandbox.io/s/5-jmwgm7?file=/src/index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants