juliancwirko / react-s-alert

Alerts / Notifications for React with rich configuration options
https://www.npmjs.com/package/react-s-alert
MIT License
649 stars 75 forks source link

JSX as Message #23

Closed mxmtsk closed 7 years ago

mxmtsk commented 8 years ago

Hi,

is it possible to add JSX a message. I tried the following, but it's showing [object Object]. It's kind of obvious to use jsx so I'd kindly like to ask if you would consider adding support for jsx? (Or did I miss something and it's already possible?)

        Alert.error(<div>
          {response.errors.map((error, index) => {(
            <div key={`ticket-error-${index}`}>
              {error.message}
            </div>
          )})}
        </div>, {
          position: 'top-right',
          effect: 'slide',
          beep: '/media/pop.mp3',
          html: true,
        });
juliancwirko commented 8 years ago

Hi, would it be what you need: https://github.com/juliancwirko/react-s-alert/pull/19 ?

mxmtsk commented 8 years ago

@juliancwirko Yes exactly, that would be what I need!

juliancwirko commented 8 years ago

Ok, I'll try to test and merge it today.

juliancwirko commented 8 years ago

Ok, in version 1.2.0 you should be able to do what you need.

juliancwirko commented 7 years ago

I'll close it for now. It should work. Let me know if you find any problems. Thanks.