react-native-easy-toast icon indicating copy to clipboard operation
react-native-easy-toast copied to clipboard

Can not use style property to custom the toast style in typescript

Open chengwb53 opened this issue 2 years ago • 1 comments

hello ,im use react-native-easy-toast 2.3.0 in my project, and use the style property get some error:

TS2769: No overload matches this call.   Overload 1 of 2, '(props: ToastComponentProps | Readonly<ToastComponentProps>): Toast', gave the following error.     Type '{ ref: (toastRef: Toast) => void; style: { backgroundColor: string; }; textStyle: TextStyle; position: ToastPositionType; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Toast> & Readonly<ToastComponentProps>'.       Property 'style' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Toast> & Readonly<ToastComponentProps>'.   Overload 2 of 2, '(props: ToastComponentProps, context: any): Toast', gave the following error.     Type '{ ref: (toastRef: Toast) => void; style: { backgroundColor: string; }; textStyle: TextStyle; position: ToastPositionType; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Toast> & Readonly<ToastComponentProps>'.       Property 'style' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Toast> & Readonly<ToastComponentProps>'.

i find the ToastComponentProps interface:

interface ToastComponentProps {
  position?: "bottom" | "center" | "top";
  textStyle?: {};
  positionValue?: number;
  fadeInDuration?: number;
  fadeOutDuration?: number;
  opacity?: number;
}

no style property

chengwb53 avatar Apr 24 '23 09:04 chengwb53

Ditto

lprhodes avatar Sep 09 '23 02:09 lprhodes