chentsulin/sweetalert-react

How to render text with html element

Closed this issue · 1 comments

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>?

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