mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 09:50:31 +01:00
16 lines
521 B
JavaScript
16 lines
521 B
JavaScript
|
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;
|