Skip to content

Conversation

@cube-dan
Copy link

@cube-dan cube-dan commented Jul 7, 2019

Greets Diego,

I've added code that allows react-redux-toastr to display markup in it's messages. This was accomplished using:

  1. domputify to do the html sanitization, see: https://github.com/cure53/DOMPurify
  2. React's dangerouslySetInnerHTML to display the markup after sanitization, see: https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml

I didn't bother making this an optional feature (to make this easier for you to review) but it probably should be?

If you like the idea of allowing markup then I'll wire in a configuration var, maybe something like allowHtml: false, and make sure that all the toastr methods play nice with the new feature. I'll update the manual along the way too if you accept this change.

Thanks Diego. Let me know if you're cool with allowing markup in the message area of the react-redux-toastr display.

-Dan

@cube-dan
Copy link
Author

Diego,

The code has moved a bit since I first submitted this PR. Would you like me to resubmit the PR with a newer version of react-redux-toastr to get rid of the merge conflict in src/ToastrBox.js?

-Dan

Currently, this lib expects the state to be at the key `toastr` (and even handles when the state object is an immutable object (via `state.get`). There is no way to define a custom / different location easily.

This adds an optional prop to the `ReduxToastr` component which is a function that takes the current state to provide the toastr state.
MirayaReie and others added 21 commits June 3, 2020 12:44
- bumping dev deps to dart-sass over deprecated node-sass
- fix to build command
* Replaced if-then-else flow by a single return statement in functions isString and isBrowser

* updated version to 7.6.9

Co-authored-by: Juan Carlos Rodriguez Salas <juan@MacBook-Pro.local>
* Rename file extension of jsx files from .js to .jsx.

* Update webpack config to support .tsx files.

---------

Co-authored-by: Nick Muller <nick@nickymuller.com>
* Fixed the "React (18.1.0) Toastr doesn't dissappear" issue

Fix toastr removal in React 18 by using transitionend event listener

* Moved the position to top-right from top-left

* Fixed to run on crosspatform

* Update client.js
Co-authored-by: printfn <printfn@users.noreply.github.com>
Add support for redux 5 and react-redux 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.