Look at this image:
What Difference Do you See?
On the left hand side, we are using solar-powered photovoltaic (PV) panels to convert sun’s rays into electricity. Once done, we are supplying it to the car that uses it to power its electric motor and runs itself. The car stores the power in the battery. It is the traditional way how a battery-powered car works.
On the right hand side, we are using PV panels to generate power which is used to separate hydrogen from water through electrolysis. Once the hydrogen is produced, we transfer it to hydrogen stations that hydrogen fuel cell vehicles can visit to fill hydrogen. The hydrogen stored in the car produces electricity by using the oxygen present in the air. The produced electricity then powers the battery that runs the car. It is how a hydrogen fuel cell car works.
While a hydrogen fuel cell car takes about 10 minutes to fill, an electric car can take about an hour to get charged.
On the other hand, in the article Why battery-powered vehicles stack up better than hydrogen, Phys says battery-powered vehicles are 3 times more efficient than Hydrogen fuel cell cars are.
Moreover, Tesla had a huge pile of unordered deliveries of its electric cars because of its excessive demand. The emergence of Hydrogen fuel cars is a huge competition.
As they say, I will leave the rest on your fine sense of judgement.