Check out example codes for "recenter google map based on route". It will help you in understanding the concepts better.

Code Example 1

map.setCenter(route.bounds.getCenter());

Learn ReactJs, React Native from akashmittal.com