Skip to content

Getting TS warning: "No overload matches this call" #189

Closed
@nexorianus

Description

@nexorianus

Using "react-native-app-intro-slider": "^4.0.2", and

<AppIntroSlider
  renderItem={this._renderItem}
  data={slides}
  //ref={(ref) => this.slider = ref} } //same with all following commented in
  //onDone={this._onDone}
  //showNextButton={false}
  //showDoneButton={false}
  //dotStyle={styles.dot}
  //activeDotStyle={styles.activeDot}
/>

im getting the following Warning from TS:

(alias) class AppIntroSlider<ItemT>
import AppIntroSlider

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<Props<unknown>>): AppIntroSlider<unknown>', gave the following error.
    Type '{ ref: (ref: AppIntroSlider<unknown>) => AppIntroSlider<unknown>; renderItem: ({ item, index }: { item: any; index: any; }) => Element; data: ISlide[]; onDone: () => void; showNextButton: false; showDoneButton: false; dotStyle: AnyStyle; activeDotStyle: AnyStyle; }' is missing the following properties from type 'Pick<Readonly<Props<unknown>> & Readonly<{ children?: ReactNode; }>, "testID" | "onDone" | "data" | "style" | "children" | "renderItem" | "renderSkipButton" | ... 139 more ... | "nestedScrollEnabled">': showPrevButton, showSkipButton
Overload 2 of 2, '(props: Props<unknown>, context?: any): AppIntroSlider<unknown>', gave the following error.
    Type '{ ref: (ref: AppIntroSlider<unknown>) => AppIntroSlider<unknown>; renderItem: ({ item, index }: { item: any; index: any; }) => Element; data: ISlide[]; onDone: () => void; showNextButton: false; showDoneButton: false; dotStyle: AnyStyle; activeDotStyle: AnyStyle; }' is missing the following properties from type 'Pick<Readonly<Props<unknown>> & Readonly<{ children?: ReactNode; }>, "testID" | "onDone" | "data" | "style" | "children" | "renderItem" | "renderSkipButton" | ... 139 more ... | "nestedScrollEnabled">': showPrevButton, showSkipButton
ts(2769)

I'm guessing, that the types passed in index.d.ts are not reflecting the optional values correctly, or the docu is out of date.

The Component renders without problems.
The Error is only in Editor.

System: macOS,
Editor: Visual Studio Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions