When you build a ship that uses stockpiled components, it gets built quicker, and at lower costs. So when the components are not too out of date, it is perfectly viable to re-use them. Otherwise just scrap for a bit of extra materials. You can also pre-fabricate ship compenents using industry for the same reasons.