rijdz
5/15/2016 - 3:20 PM

React - Elseif Condition Dynamic Button

React - Elseif Condition Dynamic Button

<ButtonToolbar>
  {(()=>{
    switch (this.props.title) {
      case "main": return <Link to="/issue-log/create"><Button bsStyle="success">New Issue</Button></Link>;
      case "create": return <Link to="/issue-log"><Button bsStyle="primary">Back</Button></Link>;
      default: return <Link to="/issue-log"><Button bsStyle="primary">Back</Button></Link>;
    }
  })()}
</ButtonToolbar>