`Umar asked the Prophet (ﷺ) "Can anyone of us sleep while he is Junub?" He replied, "Yes, if he performs ablution."
Sahih al-Bukhari Book 5, Hadith 41