Islam aims at achieving the welfare and goodness of all people. So, a pregnant woman has to consult a reliable and trustworthy physician, and then act according to his instructions.
Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author states: “The issue of breastfeeding during pregnancy should be referred to a capable and trustworthy doctor. If he says that breastfeeding the child will not harm the fetus or the nursing infant, then there is no reason not to do so and it is permissible. However, if it will harm the child or the fetus, then it is impermissible.”