"Don't let the this [expletive] affect your mental, kids," Hart tweeted Tuesday. "I love y'all and I will be back shortly."
The Philadelphia Daily News said Hart donated 500 Sony Vaio computers -- each worth about $1,100 -- to the city, which then distributed them to facilities in low-income areas.
Four of the computers were stolen late last week from the Cobbs Creek Recreation Center, apparently by someone with access to the building, the Daily News said.
"The whole situation is disheartening," Leo Dignam, deputy commissioner for parks and recreation, told the newspaper. "It's bad enough that these computers were stolen, but these kids don't need to go through this around Christmas."
Hart will soon be seen in the big-screen comedy "Grudge Match."