Solar panels etc. will last decades and can and will be recycled afterwards. Further, most materials needed for renewable energy infrastructure (iron, lithium) are highly abundant on earth. Most of the suppliers work to use cheaper (=more abundant) materials in their products, replacing lithium with sodium in batteries and silver with copper in solar panels. Wind turbine blades are produced now using re-solvable resins.
And iron (steel) is the most recyclable material we have.
Wind turbines are not recyclable[1]. Besides, the foundations use a massive amount of concrete (nowadays often extracted from the seabed, with all the problematic ecological consequences involved), that stays forever in the ground.
[1] https://www.sciencedirect.com/science/article/abs/pii/S23527...
Not only are older solar panels recyclable, but efficiency gains in panel construction mean that multiple newer panels can be created with the resources from older panels.