The Prophet ﷺ was asked about someone who slaughtered before shaving or shaved before slaughtering. He said, "There is no harm."
حدثنا علي بن محمد حدثنا سفيان بن عيينة عن الزهري عن عيسى بن طلحة
أن النبي ﷺ سئل عمن ذبح قبل أن يحلق أو حلق قبل أن يذبح قال لا حرج
Bukhari narrated it in the Book of Knowledge, chapter, Issuing a religious ruling while standing on a riding animal or the like, hadith no. 83, and others narrated the text of Zuhri's hadith through him. Muslim also narrated it in the Book of Hajj, chapter, The permissibility of performing the sacrifice before the stoning and the shaving before the sacrifice and before the stoning, and performing the tawaf before all of them, hadith no. 1306/331, from the hadith of Ibn Uyayna through him.