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

Code Example 1

var opacity = 0;

function MyFadeFunction() {
   if (opacity<1) {
      opacity += .1;
      setTimeout(function(){MyFadeFunction()},100);
   }
   document.getElementById('about').style.opacity = opacity;
}

Learn ReactJs, React Native from akashmittal.com