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

Export ToastOptions type for composing #145

Open
ChrisLFieldsII opened this issue Jul 18, 2022 · 0 comments
Open

Export ToastOptions type for composing #145

ChrisLFieldsII opened this issue Jul 18, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@ChrisLFieldsII
Copy link

ChrisLFieldsII commented Jul 18, 2022

Current behaviour

The ToastOptions type is not exported and so consumers can not use it to compose custom types for their use cases.

Ex:

import { ToastOptions } from 'react-native-toast-notifications';

type MyToastOptions = ToastOptions & {
  msg: string;
  icon: React.ReactNode;
};

Expected behaviour

The ToastOptions type is exported

What have you tried

I created a patch for now

diff --git a/node_modules/react-native-toast-notifications/lib/typescript/index.d.ts b/node_modules/react-native-toast-notifications/lib/typescript/index.d.ts
index 01bde8b..9005af6 100644
--- a/node_modules/react-native-toast-notifications/lib/typescript/index.d.ts
+++ b/node_modules/react-native-toast-notifications/lib/typescript/index.d.ts
@@ -2,3 +2,4 @@ export { default } from "./toast-container";
 export { default as ToastProvider } from "./hook/provider";
 export { default as useToast } from "./hook/useToast";
 export type { ToastType } from './hook/context';
+export type { ToastOptions } from './toast';
\ No newline at end of file

Your Environment

software version
ios or android
react-native
react-native-toast-notifications 3.2.3
node
npm or yarn
@ChrisLFieldsII ChrisLFieldsII added the bug Something isn't working label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant