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.

toast.update() not working?

See original GitHub issue

Toast Update not working:

… Component omited for brevity …


notifyNewEnterprise(enterprise) {
    let toastId = toast.info('Hello', { position: toast.POSITION.TOP_RIGHT });
    Enterprises.insert(enterprise, (err) => {
       if(!err) {
           toast.update(toastId, {
            render: 'Enterprise Created Successfully.',
            type: toast.TYPE.SUCCESS,
            className: css({
              transform: "rotateY(360deg)",
              transition: "transform 0.6s"
            })
          });
       }
   });
}

It just displays Hello Toast it doesn’t change even when the insertion to collection succeed. I’d expect it to update from info toast to success toast but I don’t know why doesn’t. How can I fix it for the intended result? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fkhadracommented, Feb 16, 2018

@rezmoth I forked your sandbox with the hotfix: Edit n496qxv8j4

@maxchehab and @DreadfulDeveloper could you update to the latest version v3.3.4 and see if it fix your issue, please. Don’t forget to clear your cache 😁

1reaction
fkhadracommented, Feb 16, 2018

Off topic @rezmoth For info the signature of your toast.update is wrong:

toast.update(this.toastId, "Enteprise created successfully.", {
        type: toast.TYPE.SUCCESS,
        autoClose: 5000
      });
// need to be 
toast.update(this.toastId, {
        render: "Enteprise created successfully.",
        type: toast.TYPE.SUCCESS,
        autoClose: 5000
      });

Maybe it could be useful to accept both. End off topic

I found a solution but if the update occurs too fast you won’t see the first message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Toast App Updates
Troubleshooting Toast App Updates · 1. Select Switch User. · 2. Once on the passcode screen tap the three white dots on the...
Read more >
Update a toast | React-Toastify - GitHub Pages
Update a toast. When you update a toast, the toast options and the content are inherited but don't worry you can update them...
Read more >
why toast.update in React-Toastify v.9 doesn't work properly
You have to set the loading to false for the autoClose to work. So add isLoading: false to the toast.update . toast.update(toast1, {...
Read more >
React Toastify Update Bug - CodeSandbox
Forked FromReact (React Toastify Working); Environmentcreate-react-app. Files. public. src. index.js. styles.css. package.json. Dependencies.
Read more >
Toast - Chakra UI
Toasts ' options can be updated, by passing an id and the new options to the update instance method. Toast Update last toast....
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