Check out example codes for "sweet alert". It will help you in understanding the concepts better.

Code Example 1

	title: "Good job!",
	text: "You clicked the button!",
	icon: "success",
	button: "Aww yiss!"

Code Example 2

     title: "Deleted!",
     text: "Your row has been deleted.",
     button: "Close", // Text on button
     icon: "success", //built in icons: success, warning, error, info
     timer: 3000, //timeOut for auto-close
      buttons: {
        confirm: {
          text: "OK",
          value: true,
          visible: true,
          className: "",
          closeModal: true
        cancel: {
          text: "Cancel",
          value: false,
          visible: true,
          className: "",
          closeModal: true,

Code Example 3

swal("Are you sure?", {  dangerMode: true,  buttons: true,});

Code Example 4

<script src=""></script>

Code Example 5

<script src="[email protected]"></script>

Code Example 6

swal({  icon: "error",});

Learn ReactJs, React Native from