Check out example codes for "how to center a div vertically and horizontally". It will help you in understanding the concepts better.

Code Example 1

.container{	
	margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
  	width: /* Define the width here; */
    height: /* Define the height here; */
}

/*You have to define the width and height! */

Code Example 2

.parent-class {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

Code Example 3

.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

Learn ReactJs, React Native from akashmittal.com