chentsulin / sweetalert-react

Declarative SweetAlert in React
http://chentsulin.github.io/sweetalert-react/
MIT License
239 stars 62 forks source link

How to render text with html element #111

Closed sudeeptarlekar closed 4 years ago

sudeeptarlekar commented 5 years ago

I want to render Sweetalert with text having HTML elements, How can I fo that? Right now I am rendering the Sweetalert like this

<SweetAlert
  show={showConfirm}
  title={title}
  text="Are you sure you want to remove task <b>Rolling</b>?"
  showCancelButton
  confirmButtonText="Confirm"
  customClass="confirm-modal confirm-delete-modal"
  onConfirm={this.handleConfirmClick}
  onCancel={this.hideConfirm}
/>

So here, instead of showing Rolling in bold letters it is rendering text as Are you sure you want to remove task <b>Rolling</b>?

dominicrico commented 5 years ago

use html={'...'} instead of text={'...'}