Umm Sulaym came to the Messenger of Allah ﷺ and said, "Messenger of Allah, Allah is not shy of the truth. Does a woman have to perform a ritual bath if she has a wet dream?"He replied, "Yes, if she sees the fluid."Umm Salama laughed and said, "Does a woman have wet dreams?"The Messenger of Allah ﷺ responded, "Then how else would her child resemble her?"
أخبرنا شعيب بن يوسف قال حدثنا يحيى عن هشام قال أخبرني أبي عن زينب بنت أم سلمة
يا رسول الله إن الله لا يستحيي من الحق هل على المرأة غسل إذا هي احتلمت قال نعم إذا رأت الماء فضحكت أم سلمة فقالت أتحتلم المرأة فقال رسول الله ﷺ ففيم يشبهها الولد
Bukhari narrated it in the Book of Knowledge, Chapter on Modesty in Seeking Knowledge, hadith 332/130, from the report of Yahya Qattan. Muslim also narrated it in the Book of Menstruation, Chapter on the Obligation of Ghusl for a Woman upon the Emission of Fluid, hadith 313, from the report of Hisham bin Urwa, with the same wording. It is also found in al-Kubra, hadith 201.