fkhadra / fkhadra/react-toastify
Add custom data attributes to Toasts
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 741
- PR merge metrics
- No merged PRs in 30d
Description
Hi and thank you for `react-toastify`! Using it has been very straightforward so far 👍
**Do you want to request a *feature* or report a *bug*?**
A *feature*
**What is the current behavior?**
We can add ids and classes to the toasts, but no data attributes.
**What is the expected behavior?**
We can additionally add data attributes to toasts, eg via
```js
toast('🦄 Wow so easy!', {
...
dataAttributes: {
'data-cy': 'unicorn-toast'
}
});
```
so that the resulting rendered toast has the provided data attributes

(obviously we're trying to test the toasts using Cypress und want to adhere to the [best practices](https://docs.cypress.io/guides/references/best-practices#Selecting-Elements) and use `data-cy` attributes instead of IDs or classes)
Contributor guide
Assessment
This issue has not been assessed yet.