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."
أنه قال لرسول الله ﷺ: أي رسول الله ﷺ، أرأيت أمورا كنت أتحنث بها في الجاهلية، من صدقة، أو عتاقة، أو صلة رحم، أفيها أجر؟ فقال رسول الله ﷺ: أسلمت على ما أسلفت من خير.