Sayyiduna Abu Qatadah Ansari (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings of Allah be upon him) picked up Umamah bint Zaynab during the prayer; when he would prostrate, he would put her down, and when he stood up, he would pick her up.
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1398
Hadith Takhrijاس حدیث کے حوالے کے لئے مذکورہ بالا مصادر ملاحظہ فرمائیں۔ نیز دیکھئے: [ابن حبان 109، 110] ، [الحميدي 426]
Brief Explanation
(Commentary on Hadiths 1396 to 1398)
From this hadith, it is understood that such minor actions do not invalidate the prayer. In the same way, if someone performing prayer picks up a child and then puts the child down at the time of bowing (ruku) or prostration (sujud), this will not cause any disruption in the prayer.
The Prophet of Mercy (sallallahu alayhi wa sallam), who was the leader of mankind, the most God-fearing, and the most knowledgeable about Allah, by doing this himself, made things easy for mothers with children.
May Allah send countless blessings upon his sacred being.