Hakeem bin Hizam reported,

He said to the Messenger of Allah ﷺ, "Messenger of Allah, what do you say about acts of devotion I used to perform in the days of ignorance, such as giving charity, freeing slaves, and maintaining ties of kinship? Will I be rewarded for them?"The Messenger of Allah ﷺ replied, "You have embraced Islam along with all the good you previously did."

Azami 14069

Sahih

عن حكيم بن حزام

أنه قال لرسول الله ﷺ: أي رسول الله ﷺ، أرأيت أمورا كنت أتحنث بها في الجاهلية، من صدقة، أو عتاقة، أو صلة رحم، أفيها أجر؟ فقال رسول الله ﷺ: أسلمت على ما أسلفت من خير.

الأعظمي 14069صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Righteousness and maintaining ties
Section
One who maintained family ties during shirk, then accepted Islam
Numbering
Jami al-Kamil 14069 (2nd edition)
Azami 14069