Dinosaurs, like all modern birds and most reptiles, laid eggs. In recent years, many fossilized eggs and nests have been discovered, although we aren’t always sure what kind of dinosaur they belong to.
History
Although we have never been able to identify a T. rex nest full of eggs, we do know that many other dinosaurs made nests, so T. rex almost certainly made them as well. Typically, the parent dinosaur would dig a shallow pit, lay the eggs in it. Each species of dinosaur appear to have laid the eggs in a characteristic pattern (e.g., in a ring, or standing on end) and then cover them with some soil or vegetation. At least one small theropod has been discovered still sitting on its nest just like a bird, but we don’t know if T. rex did this. Given its enormous size and weight, T. rex would have had to be extremely careful not to crush them. When the hatchling emerges from the egg, it was able to move around and feed almost immediately, and so probably did not require any parental care.