Currently, I am changing the height of a container from 0px to auto. Since I do not know the exact final height needed for the container, using max-height could be an option but I prefer this method.
The transition from 0 to auto works smoothly, however, when going back from auto to 0, the animation duration is not as expected compared to collapsing and expanding (height 0 to auto).
To see an example, visit: https://codesandbox.io/s/q3471wj81w