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

Code Example 1

swal({
	title: "Good job!",
	text: "You clicked the button!",
	icon: "success",
	button: "Aww yiss!"
});

Code Example 2

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

Learn ReactJs, React Native from akashmittal.com