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

Code Example 1

input[type=text] {
  width: 100px;
  transition: width .35s ease-in-out;
}


 input[type=text]:focus {
  width: 250px;
}

Learn ReactJs, React Native from akashmittal.com