Check out example codes for "UI API called on a background thread". It will help you in understanding the concepts better.

Code Example 1

DispatchQueue.main.async {
    //Do UI Code here. 
    //Call Google maps methods.
}

Learn ReactJs, React Native from akashmittal.com