Medications while pregnant

Did any of you ladies have to take medications you weren’t supposed to through pregnancy and your baby be ok? I have to take propranolol for my heart problem. Doctor doesn’t like me taking it but there’s nothing else I can take and if I dont my heart rate will be 180..