They are worse on the environment then gasoline cars due to the rare earth materials needed to make a EV and it is harsher on the environment when it comes to dispose a EV once they reach end of life.
While it's typically true that making an EV car has more environmental impact than an ICE vehicle, this is more than compensated for by the emissions while driving, says also the EPA. Additionally, new LFP batteries are taking over the EV market and do not require rare earth minerals.
And all a EV car does is demand energy from a power plant which are either using coal or natural gas for the most part. The only "green" efficient power plant option out there is nuclear but no one wants to go nuclear.
Yes, let's just ignore hydro, solar and wind power altogether. Renewable sources are currently almost 25% of US electricity production (more than coal) and growing rapidly. Also, even if you charge the EV with energy from a coal power plant, it's still better than a gasoline car. The reason is efficiency. Power plants are more efficient at getting energy from fuel than a car engine, and electrical engines are more efficiently converting energy to motion.
If your concered about the climate and want to take that into account when getting a new vehicle. I always tell people to buy a used vehicle since it already exists and by driving a used car
This is not bad advice, but even better would be to buy a used EV.