shahen94 / react-native-switch

Customisable switch component for RN
MIT License
296 stars 172 forks source link

feat: add testID in typescript interface #94

Closed vasylnahuliak closed 3 years ago

vasylnahuliak commented 3 years ago

Fix typescript error on missing testID prop

No overload matches this call.
  Overload 1 of 2, '(props: SwitchProps | Readonly<SwitchProps>): Switch', gave the following error.
    Type '{ value: false; onValueChange: () => void; testID: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Switch> & Readonly<SwitchProps> & Readonly<{ children?: ReactNode; }>'.
      Property 'testID' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Switch> & Readonly<SwitchProps> & Readonly<{ children?: ReactNode; }>'.
  Overload 2 of 2, '(props: SwitchProps, context: any): Switch', gave the following error.
    Type '{ value: false; onValueChange: () => void; testID: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Switch> & Readonly<SwitchProps> & Readonly<{ children?: ReactNode; }>'.
Property 'testID' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Switch> & Readonly<SwitchProps> & Readonly<{ children?: ReactNode; }>'.ts(2769)

image

VadymBatryn commented 3 years ago

Please update package on npm