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

No overload matches this call #614

Open
tsachit opened this issue Jan 18, 2023 · 7 comments
Open

No overload matches this call #614

tsachit opened this issue Jan 18, 2023 · 7 comments

Comments

@tsachit
Copy link

tsachit commented Jan 18, 2023

Could be something like this

Describe the bug
When I try to use swipe row i get typescript error, it works but the typescript error is annoying and it keeps failing compiling typescript. It seems like SwipeRow does not allow children. When i don't send any children and use just the close it without any children it doesn't give any typescript error.
image

To Reproduce
Steps to reproduce the behavior:
Just use like in the example https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/SwipeRow.md

Screenshots
image

Environment (please complete the following information):

  • OS: iOS
  • RNSLV Version: ^3.2.9
  • RN Version: 0.68.5
@vickycabrera
Copy link

Same error here!

  • OS: Android
  • RNSLV Version: ^3.2.9
  • RN Version: 0.70.5

@D4RKBR4IN
Copy link

Hi i have the same error, both android and IOS
"react-native-swipe-list-view": "^3.2.9",
"react-native": "0.70.6",

Because typescript needs everything declared...
Apparently children definition is missing on SwipeRow as one of the props.

any development on this problem predicted any time soon ?

@carlvelasco96
Copy link

I also need a fix for this issue! Just waiting for an update on this thread about a potential fix.

@lgibso34
Copy link

lgibso34 commented Mar 29, 2023

While we wait...

Either // @ts-expect-error it or create a <something>.d.ts file and add this to it.

import {ReactNode} from 'react'

declare module 'react-native-swipe-list-view' {
  interface IPropsSwipeRow<T> {
    children: ReactNode
  }
}

@BuhorDenysDEV
Copy link

also have this problem.
Has something been done to fix it?

this way didn't help me(

@helferleinsoftware
Copy link

helferleinsoftware commented Nov 18, 2023

improving on @lgibso34 s suggestion, I explicitly declared that the <SwipeRow> needs two children

// src/custom-types.d.ts
import { IPropsSwipeRow } from 'react-native-swipe-list-view';

declare module 'react-native-swipe-list-view' {
  interface IPropsSwipeRow extends IPropsSwipeRow {
    children: [unknown, unknown];
  }
}

@vasylnahuliak
Copy link

React has a type helper for working with the children

import { IPropsSwipeRow } from 'react-native-swipe-list-view';

declare module 'react-native-swipe-list-view' {
  interface IPropsSwipeRow extends React.PropsWithChildren {}
}

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

8 participants