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

Code Example 1

<style>
.myelement{
  animation: fade-out;
}

@keyframes fade-out{
  0%{
    opacity: 1.0
  }
  100{
    opacity: 0.0
  }
}
</style>

Learn ReactJs, React Native from akashmittal.com