A helper to traverse a component's dependencies.