Yes we can electrolyse water with solar energy, but untill solar reach 35 % of our needs, it is easier to use the electricity produced by solar without storing it.
In the future we could provide 100 % of our need with renewable. Wind 45 % solar 35 % hydroelectricity 10 % geothermal, biomass..;then we will need storage. But H2 is difficult to store too. McPhy energy is producing metal hydrure to store H2. Vanadium flow batteries may be more efficient
https://spectrum.ieee.org/green-tech/fuel-cells/its-big-and-longlived-and-it-wont-catch-fire-the-vanadium-redoxflow-battery