Giving birth to live young is one of the traits we use to distinguish mammals from other animals. But certain kinds of lizards, snakes and amphibians, both living and extinct, also reproduce without laying eggs.
It seems to have been a common reproductive strategy in particular for extinct aquatic reptiles, such as the fish-like ichthyosaurs, plesiosaurs and mosasaurs that lived at the same time as the dinosaurs.
A certain evidence shows that species of archosauromorphs gave birth to live young. Yet archosauromorphs evolved away from this reproductive strategy to become the egg-laying dinosaurs, and eventually
crocodiles and birds that we know.