question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add own options to custom toast component

See original GitHub issue

Hi, Today found one use case for passing custom options. In my case i want to pass icon name to component. It is actually possible with directly passing but there is errors about Object literal may only specify known properties, and 'toastIcon' does not exist in type 'Partial<IndividualConfig>'

Is there any workarounds for this ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
frct1commented, Jan 12, 2020

I’ve now looked at componentInstance, showing that it is undefined. Strange

image

1reaction
scttcpercommented, Jan 12, 2020
const inserted = this.toastr.show('message', 'title');
inserted.toastRef.componentInstance.myProperty = 'something';

can access the component instance directly after creation

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a custom toast component with React
To create a toast component, create a folder called toast inside the components directory and add two files: Toast.js and Toast.css . We...
Read more >
Create custom toast components with React
In this tutorial, I will show you how to use React to create a custom toast component as well as React hooks such...
Read more >
Create a Custom Toast Component with React - YouTube
Learn to create a custom toast component with React. Use react hooks like useState and useEffect. Create the react toast component from ...
Read more >
How to create a custom toast component with React
In this tutorial, I'll show you how to create a custom toast component with React. We'll use React hooks like useState and useEffect....
Read more >
Building a toast component - web.dev
JavaScript now adds a container to the document for containing toasts and is ready to add created toasts. The addToast() function orchestrates ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found