1
0
mirror of https://github.com/ascribe/onion.git synced 2024-09-28 12:08:55 +02:00
onion/js/mixins/alert_mixin.js

16 lines
521 B
JavaScript
Raw Normal View History

import React from 'react';
import AlertDismissable from '../components/ascribe_forms/alert';
let AlertMixin = {
setAlerts(errors){
let alerts = errors.map(
function(error) {
let key = error + this.state.retry;
return <AlertDismissable error={error} key={key}/>;
}.bind(this)
);
this.setState({alerts: alerts, retry: this.state.retry + 1});
}
};
export default AlertMixin;