My view is that earlier units should still be available when the new unit comes along (for reasons of lower unit cost if this is an issue, special abilities that will be lost, required strategic resources not being available etc), and only become obsolete somewhat later. In World War 1, armies where still using cavalry even when tanks were being fielded (though tanks were obviously in their infancy). It would probably make more sense if the time periods in Civ6 were more spaced apart to allow for some overlap of units from different eras.
Currently, unit obsolesance doesn't really make sense. I researched the tech that gives modern tanks, and suddenly, I could no longer build the earlier tanks. I also couldn't build the new modern tanks, since I didn't have uranium. I couldn't see any uranium either since I hadn't researched that tech at that stage. I had to instead go through a few more tech advances before I could see uranium on the map, connect it to my empire, and then make tanks (the modern variety). It was a pain, and made no sense at all (my civilization suddenly lost the ability to make tanks because they researched how to make modern tanks which required a resource that they didn't know about yet (but really, historically, uranium wasn't required to make modern tanks anyway)...).