1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 09:50:31 +01: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;