According to a new IEA study, mining doesn't undermine EV potential for reducing CO2 emissions. EVs require a lot of mined materials but lifecycle emissions are just 50% of gasoline cars, and can go down to 25% if manufacturing is powered by low carbon energy.
https://www.iea.org/reports/the-role-of-critical-minerals-in-clean-energy-transitions