How to use the react-alert.withAlert function in react-alert

To help you get started, we’ve selected a few react-alert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benkaiser / stretto / src / js / services / alerter.jsx View on Github external
...style,
        marginRight: '25px'
      };
    }
    let type = options.type;
    type == 'error' && (type = 'danger');
    return (
      <div style="{style}">
        <button data-dismiss="alert" type="button">×</button>
        {message}
      </div>
    );
  }
}

const AlerterWithAlert = withAlert(Alerter);

export class AlerterContainer extends React.Component {
  render() {
    return (
      
        
      
    )
  }
}
github bradtraversy / lead_manager_react_django / leadmanager / frontend / src / components / layout / Alerts.js View on Github external
if (message.addLead) alert.success(message.addLead);
      if (message.passwordNotMatch) alert.error(message.passwordNotMatch);
    }
  }

  render() {
    return ;
  }
}

const mapStateToProps = state =&gt; ({
  error: state.errors,
  message: state.messages
});

export default connect(mapStateToProps)(withAlert(Alerts));