Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6212

Type definition for react-native-checkbox

$
0
0

I'm trying to create a type definition file for react-native-checkbox. Here's what I have in the .d.ts file:

declare module '@react-native-community/checkbox' {  import * as React from 'react';  interface CheckBoxProps {    disabled?: boolean;    value?: boolean;    tintColors?: {      true?: string;      false?: string;    };    onChange?: () => void;    onValueChange?: (value: boolean) => void;  }  export class CheckBox extends React.Component<CheckBoxProps> {}}

But, when I use the <CheckBox /> in my screens, I get the following error:

JSX element type 'CheckBox' does not have any construct or call signatures.ts(2604)

What am I missing?


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>