This article is from the Star Trek Tech FAQ, by Joshua Bell inexorabletash@hotmail.com with numerous contributions by others.
For minor repair, it might be feasible, but we rarely see any sort of
repairs actually being done. When Geordi says "30 minutes at least,
Captain", they might be replicating various components and using a
transporter-effected swap-out. Recall, however, that the transporters
and replicators use a lot of power. The replicators go offline in
Alert situations, for example. It would be foolish to rely on such a
system to repair the ship in emergencies, but it is doubtless used at
other time.
For large scale repair, I think the TNG Tech Manual says it best: "...
if you could make a starship at the touch of a button, you wouldn't
need to..."
 
Continue to: