fkhadra / fkhadra/react-toastify

Add support for passing an array of ids to the `containerId` prop

Open
#1,162 1 comment 0 reactions 0 assignees View on GitHub
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: Add support for passing an array of strings or numbers to the `containerId` prop.

**What is the current behavior?**
Currently, we cannot show a toast in multiple containers without executing or calling the `toast()` function multiple times.

```javascript
toast("hello Default", {
autoClose: false,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
containerId: "gpt",
});

toast("hello Default", {
autoClose: false,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
containerId: "default",
});
```

**What is the expected behavior?**
We expect that the `toast` function accepts a list of `containerId`s to show/attach to it.

```javascript
toast("hello Default", {
autoClose: false,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
containerId: ["default", "gpt"],
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.