Check out example codes for "swalert 2 show loader". It will help you in understanding the concepts better.

Code Example 1

Swal.fire({
                title: 'Please Wait !',
                html: 'data uploading',// add html attribute if you want or remove
                allowOutsideClick: false,
                onBeforeOpen: () => {
                    Swal.showLoading()
                },
            });

Learn ReactJs, React Native from akashmittal.com