What laws should the British royal family obey during pregnancy?

Pregnant women in the royal family must attend all official ceremonies until the birth of their child. But after the birth of a child, attending these events is not compulsory so that they can take care of their newborn baby. But this period, which is a kind of maternity leave, should not last more than 5 months.