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.

<Toaster /> duration prop not changing duration of the notification

See original GitHub issue

Giving your nice react-hot-toast npm a run in a project I’m working on. We have a simplistic alerts system and just today started looking at libs to upgrade our UI. Trying yours out after reading a blurb from a @tylermcginnis newsletter.

We literally copied this code from your <Toaster /> API page and tweaked the duration really long to 30 seconds (30000) while testing some other things but the duration doesn’t seem to be honored:

<Toaster
  position="top-center"
  reverseOrder={false}
  toastOptions={{
    // Define default options
    style: {
      margin: '40px',
      background: '#363636',
      color: '#fff',
      zIndex: 1,
    },
    duration: 5000,
    // Default options for specific types
    success: {
      duration: 3000,
      theme: {
        primary: 'green',
        secondary: 'black',
      },
    },
  }}
/>

We will keep playing around with it and let you know if we determine it is something in our code.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
tylermcginniscommented, Dec 24, 2020

Chiming in here to say I love this lib @timolins. Just added it to our project (replacing react-toastify) and it’s a joy to work with. Great job.

1reaction
timolinscommented, Dec 21, 2020

Just published v1.0.1 which addresses this issue. Let me know if that worked for you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notification like Toast but with longer duration - Stack Overflow
I have to create a notification like an android toast notification but I need to throw it from a service and I need...
Read more >
GitHub - jossmac/react-toast-notifications
ToastProvider Props​​ Default 5000 . The time until a toast will be dismissed automatically, in milliseconds. Default: false . Whether or not to...
Read more >
toast() API
Creates a custom notification with JSX without default styles. ... Every type has its own duration. You can overwrite them duration with the...
Read more >
Toast - .NET MAUI Community Toolkit - Microsoft Learn
Toast is a timed alert that appears at the bottom of the screen. It is automatically dismissed after a configurable duration of time....
Read more >
Toast | Android Developers
public static final int LENGTH_SHORT. Show the view or text notification for a short period of time. This time could be user-definable. This...
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