Closed thomashagstrom closed 3 years ago
When installing this lib in a TypeScript project (e.g default Expo project) the included definition does not work.
Should probably look like this (which I'm using):
/// <reference types="node" /> declare module 'toggle-switch-react-native' { import React from 'react'; import {StyleProp, TextStyle, ViewStyle} from 'react-native'; export type ToggleSwitchProps = { isOn: boolean; label?: string; onColor?: string; offColor?: string; size?: string; labelStyle?: StyleProp<TextStyle>; thumbOnStyle?: StyleProp<ViewStyle>; thumbOffStyle?: StyleProp<ViewStyle>; trackOnStyle?: StyleProp<ViewStyle>; trackOffStyle?: StyleProp<ViewStyle>; onToggle?: (isOn: boolean) => any; icon?: React.ReactNode; disabled?: boolean; animationSpeed?: number; useNativeDriver?: boolean; circleColor?: string; }; class ToggleSwitch extends React.Component<ToggleSwitchProps> {} export default ToggleSwitch; }
When installing this lib in a TypeScript project (e.g default Expo project) the included definition does not work.
Should probably look like this (which I'm using):