You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a module declaration for this library to get it working in typescript. Here it is for anyone else that has this issue, feel free to open a PR and include this in the package, but it works in my project just manually declaring this in a type file:
declare module 'radio-buttons-react-native'{import*asReactfrom'react';import{StyleProp,TextStyle,ViewStyle}from'react-native';exporttypeanimationTypes='zoomIn'|'pulse'|'shake'|'rotate';exportinterfaceRadioButtonProps<ItemType>{/** Defaults to [] */data: ItemType[];selectedBtn?: (value: ItemType)=>void;icon?: React.ReactNode;/** Defaults to true */box?: boolean;/** Defaults to -1 */initial: number|null;/** Defaults to [] */animationTypes?: animationTypes[];/** Defaults to 500 */duration?: number;/** Defaults to {} */style?: StyleProp<ViewStyle>;/** Defaults to {} */boxStyle?: StyleProp<ViewStyle>;/** Defaults to {} */textStyle?: StyleProps<TextStyle>;/** Defaults to 18 */circleSize?: number;/** Defaults to '#03a9f4' */activeColor?: string;/** Defaults to '#e2e2e2' */deactiveColor?: string;/** Defaults to '#e1f5fe33' */boxActiveBgColor?: string;/** Defaults to '#fff' */boxDeactiveBgColor?: string;/** Defaults to '#383838' */textColor?: string;}exportdefaultclassRadioButtonRN<T>extendsReact.Component<RadioButtonProps<T>,unknown>{}}
The text was updated successfully, but these errors were encountered:
thanks for providing this declaration for typescript users, however, the initial prop value is optional and therefore i suggest you use initial?: number | null; instead. Thank you
I made a module declaration for this library to get it working in typescript. Here it is for anyone else that has this issue, feel free to open a PR and include this in the package, but it works in my project just manually declaring this in a type file:
The text was updated successfully, but these errors were encountered: