fkhadra / fkhadra/react-toastify
Fixed order of a toast in a toast container.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 741
- PR merge metrics
- No merged PRs in 30d
Description
**Do you want to request a *feature* or report a *bug*?**
Feature
**What is the current behavior?**
The toasts cannot be ordered programmatically in a toast container.
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:**
**What is the expected behavior?**
We would like to make it possible to order the toasts programmatically so that long running toasts like loading, promise, etc can stay at the bottom whereas temporary notification toast are stacked above it.
**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
This feature does not exist at the moment or is not possible with the existing configuration.
I have a proof of concept ready for this feature which basically adds an option called *order* (number) to the `ToastProps` type. Based on the value of order, the `ToastContainer` renders the toasts. So, this option can be used to insert the new toast wherever we want to in the container's toast stack. I can create a Pull Request if you think this could be useful.
Contributor guide
Assessment
This issue has not been assessed yet.