The Messenger of Allah ﷺ used to pray while carrying Umama, the daughter of Zaynab, daughter of the Messenger of Allah ﷺ. When he prostrated, he would set her down, and when he stood up, he would carry her again.
حدثنا القعنبي حدثنا مالك عن عامر بن عبد الله بن الزبير عن عمرو بن سليم
أن رسول الله ﷺ كان يصلي وهو حامل أمامة بنت زينب بنت رسول الله ﷺ فإذا سجد وضعها وإذا قام حملها
Muslim narrated it in Kitab al-Masajid, chapter on the permissibility of carrying children during prayer, etc., hadith no. 543, from Qanabi, and Bukhari, in Kitab al-Salah, chapter titled "If he carries a small girl on his neck during prayer," hadith no. 516, from the hadith of Malik, by this same route. It is also found in the Muwatta (the version of Yahya), 1/170.