Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chengwb53 opened this issue Apr 24, 2023 · 1 comment
Open

Comments

@chengwb53
Copy link

chengwb53 commented Apr 24, 2023

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

@lprhodes
Copy link

lprhodes commented Sep 9, 2023

Ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants