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

Custom alert type with typescript #176

Open
yerlantemir opened this issue May 12, 2021 · 1 comment
Open

Custom alert type with typescript #176

yerlantemir opened this issue May 12, 2021 · 1 comment

Comments

@yerlantemir
Copy link

How to repeat example from #121 with typescript ? I am facing error:

TS2345: Argument of type '{ CUSTOM_TYPE: string; }' is not assignable to parameter of type 'AlertCustomOptionsWithType'.

@yerlantemir
Copy link
Author

yerlantemir commented May 12, 2021

I came up on creating my custom useAlert hook with showAlert method which similarly takes message and type as arguments. And if type === Warning, I add '_' to my message and call alert.show method from library
image

And in my AlertTemplate I do this:
image

Where:
image

I know that it's kinda weird solution, but it works ! :)

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

1 participant