Narrated Abu Bakra
We were with Allah's Messenger (ﷺ) when the sun eclipsed. Allah's Messenger (ﷺ) stood up dragging his cloak till he entered the Mosque. He led us in a two-rak`at prayer till the sun (eclipse) had cleared. Then the Prophet (p.b.u.h) said, "The sun and the moon do not eclipse because of someone's death. So whenever you see these eclipses pray and invoke (Allah) till the eclipse is over."
Narrated Abu Mas`ud
The Prophet (ﷺ) said, "The sun and the moon do not eclipse because of the death of someone from the people but they are two signs amongst the signs of Allah. When you see them stand up and pray."
Narrated Ibn `Umar
The Prophet (ﷺ) said, "The sun and the moon do not eclipse because of the death or life (i.e. birth) of someone but they are two signs amongst the signs of Allah. When you see them offer the prayer."
Narrated Al-Mughira bin Shu`ba
"The sun eclipsed in the lifetime of Allah's Messenger (ﷺ) on the day when (his son) Ibrahim died. So the people said that the sun had eclipsed because of the death of Ibrahim. Allah's Messenger (ﷺ) said, "The sun and the moon do not eclipse because of the death or life (i.e. birth) of someone. When you see the eclipse pray and invoke Allah."