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

Unable to show custom icon in the toast #269

Open
babarbahadur opened this issue Nov 7, 2023 · 1 comment
Open

Unable to show custom icon in the toast #269

babarbahadur opened this issue Nov 7, 2023 · 1 comment

Comments

@babarbahadur
Copy link

I've tried a couple of solutions to render but unfortunately none of them work.

Solution#1

showMessage({
icon: 'info',
   message: 'No network connection',
   type: 'danger',
   icon: <Icon name={"calendar-blank"} size={20} color={'red} />
})

Solution#2

showMessage({
icon: 'info',
   message: 'No network connection',
   type: 'danger',
   icon: () => { return(<Icon name={"calendar-blank"} size={20} color={'red} />)}
})

Solution#3

showMessage({
icon: 'info',
   message: 'No network connection',
   icon: <Icon name={"calendar-blank"} size={20} color={'red} />
})

Nothing works :/

@lucasferreira
Copy link
Owner

Hi @babarbahadur

I don't know how your Icon componente works, but try something like this:

showMessage({
   message: 'No network connection',
   icon:  props => <Icon name="calendar-blank" size={20} color="red" {...props} />,
   type: 'danger',
})

But again, I don't know your Icon component, and I don't know also what is "calendar-blank" not either if it really 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

2 participants