react-native-swipe-list-view icon indicating copy to clipboard operation
react-native-swipe-list-view copied to clipboard

No overload matches this call

Open tsachit opened this issue 2 years ago • 7 comments

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

tsachit avatar Jan 18 '23 14:01 tsachit

Same error here!

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

vickycabrera avatar Jan 18 '23 22:01 vickycabrera

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 ?

D4RKBR4IN avatar Mar 15 '23 18:03 D4RKBR4IN

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

carlvelasco96 avatar Mar 19 '23 02:03 carlvelasco96

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
  }
}

lgibso34 avatar Mar 29 '23 18:03 lgibso34

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

this way didn't help me(

BuhorDenysDEV avatar Sep 04 '23 15:09 BuhorDenysDEV

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];
  }
}

helferleinsoftware avatar Nov 18 '23 21:11 helferleinsoftware

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 {}
}

vasylnahuliak avatar Apr 11 '24 14:04 vasylnahuliak