I divorced my wife while she was menstruating. Umar mentioned this to the Messenger of Allah ﷺ, who said, "Order him to take her back until she becomes pure, then menstruates, then becomes pure again. After that, if he wishes, he may divorce her before having relations with her, and if he wishes, he may keep her. This is the waiting period that Allah has commanded."
حدثنا أبو بكر بن أبي شيبة حدثنا عبد الله بن إدريس عن عبيد الله عن نافع
طلقت امرأتي وهي حائض فذكر ذلك عمر لرسول الله ﷺ فقال مره فليراجعها حتى تطهر ثم تحيض ثم تطهر ثم إن شاء طلقها قبل أن يجامعها وإن شاء أمسكها فإنها العدة التي أمر الله
Reported by Muslim, in the Book of Divorce, chapter on the prohibition of divorcing a menstruating woman without her consent, and that if one violates this the divorce nonetheless takes effect and he is ordered to take her back, hadith no. 2/1471, from Ibn Abu Shayba and others, with this wording. Bukhari also reported it, hadith no. 5251, as did Muslim and others, through the route of Malik from Nafi, with this wording.