schiehll / react-alert

alerts for React
MIT License
607 stars 99 forks source link

Missing Alert warning type support #163

Closed nikitastryuk closed 4 years ago

nikitastryuk commented 4 years ago

Usually, there are 4 alert types: image

Any plans to extend api to support WARNING type?

export const types = { INFO: 'info', SUCCESS: 'success', WARNING: 'warning', // This one is missing ERROR: 'error' }

alert.warning('msg'); // Can not be done in current version

besLisbeth commented 4 years ago

Hi @nikitastryuk,

I think that you can try to do it via calling alert.show('Message', { type: ''warning }) and writing your own AlertTemplate for the warning type. I suppose, that there won't be any problems with this, as this property passes directly to the template in the current implementation, but you won't be able to pass it as the default alert type to the Provider component.

I'm not sure about the extending of the library in the near time, I hope, that @schiehll will help us to clarify the issue