Check out example codes for "css transition visibility". It will help you in understanding the concepts better.

Code Example 1

.m-fadeOut {
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear 300ms, opacity 300ms;
}
.m-fadeIn {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s linear 0s, opacity 300ms;
}

Learn ReactJs, React Native from akashmittal.com