Menu
React-Toastify
GitHub
React-Toastify
  • GitHub
  • Getting Started
    • Introduction
    • Installation
    • 🚀 Migrate to v9
    • Migrate to v8
    • Release notes
  • Usage
    • Positioning toast
    • Handling autoClose
    • Render more than string
    • Remove toast programmatically
    • Handling promise
    • Icons
    • Pause toast timer when the window loses focus
    • Use a custom id
    • Prevent duplicate
    • Delay notification appearance
    • Limit the number of toast displayed
    • Use a controlled progress bar
    • Update a toast
    • Define callback
    • Listen for changes
    • Use a custom close button or remove it
    • Add an undo action to a toast (like Google Drive)
    • Usage with redux
    • Replace the default transition
    • Define a custom enter and exit animation
    • Drag to remove
    • Enable right to left support
    • Accessibility
    • Multi containers
    • How to style
    • Dispatch toast outside of react component
  • Addons
    • useNotificationCenter
  • API Reference
    • ToastContainer
    • toast
    • cssTransition
    • collapseToast
    • useToastContainer
    • useToast

Pause toast timer when the window loses focus

The default behavior is to pause the toast timer whenever the window loses focus. You can opt-out by setting the pauseOnFocusLoss props to false.

// Opt-out for all toast
<ToastContainer pauseOnFocusLoss={false} />
// Opt-out per toast
toast('Hello', {
pauseOnFocusLoss: false
})
Edit this page
Previous
« Icons
Next
Use a custom id »
Copyright © 2022 Fadi Khadra