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

OnPageSelected No overload matches this call. #184

Open
dinesh547 opened this issue Mar 2, 2020 · 0 comments
Open

OnPageSelected No overload matches this call. #184

dinesh547 opened this issue Mar 2, 2020 · 0 comments

Comments

@dinesh547
Copy link

I am trying to use the rn-viewpager.
But getting a warning on using OnPageSelected Inside <IndicatorViewPager

Code is something like this

<IndicatorViewPager
style={{ height: height - (Platform.OS === 'android' ? 50 : 80) }}
indicator={this.renderDotIndicator()}
onPageSelected={this.getSelectedPage}
ref={viewPager => {
this.viewPager = viewPager;
}}>

//Something here

Warning appears something like this.

(JSX attribute) onPageSelected: (e: any) => void
No overload matches this call.
Overload 1 of 2, '(props: Readonly): IndicatorViewPager', gave the following error.
Type '{ children: Element[]; style: { height: number; }; indicator: Element; onPageSelected: (e: any) => void; ref: (viewPager: IndicatorViewPager | null) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<...>'.
Property 'onPageSelected' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<...>'.
Overload 2 of 2, '(props: IndicatorViewPagerProps, context?: any): IndicatorViewPager', gave the following error.
Type '{ children: Element[]; style: { height: number; }; indicator: Element; onPageSelected: (e: any) => void; ref: (viewPager: IndicatorViewPager | null) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<...>'.
Property 'onPageSelected' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<...>'.ts(2769)

Do anyone has any fix fo this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant