The simple solution to that problem is indeed batteries. Currently battery production is growing exponentially. Factories are crossing into the TWH per year territory. That's right now.
Batteries are going to be absolutely everywhere. There are going to be millions of EVs on the road and plugged into the grid technically capable to absorb from and deliver energy to the grid. And that's just cars.
For reference, one mid size EV with about 50KWH of battery is the equivalent of about 4-5 days of electricity usage for a normal household. 2 million such EVs would provide about 1 TWH of battery capacity, enough to power up to 10 million houses for a day.
Now add wind, solar, domestic solar (on your roof, windows) and grid cables to the mix and we are talking about a massive distributed network of periodically (over) producing sites and hundreds of millions of EVs, trucks, grid batteries, and other energy storage solutions capable of either delivering or soaking up or delivering in the order of PWH energy. That's basically happening in the next two decades.
So, we won't need gas plants or nuclear plants on the grid long term. Or rather, we might use them if they get much cheaper than they are currently are or are expected to be.
Of course, any kind of planning involving today's price levels of battery or electricity cost are probably off by orders of magnitude as clean energy solutions and batteries are still dropping in cost.
A 10x drop in price is entirely feasible with improvements in efficiency, mass production, use of cheaper materials, etc. For both solar and battery. There are so many companies working on a wide variety of this kind of improvements that I'd go as far as saying that that 10x drop in price is more a question of when than if. 'When' here is about 2 decades or less. It's the 100x mark that interests me because I believe that's feasible as well but obviously a bit further out.
A 100x drop in the price of electricity (measured in $ per KWH) completely and utterly destroys the business case for any form of nuclear currently being planned, considered, or dreamed of. Or rather it reduces it to a niche market for places where it is desirable to have lots of power but impractical to be connected to the grid, lots of batteries, and wind/solar solutions. These places exist of course. But they are far from populated areas. Think remote sites in the arctic, large ships, etc. Small reactors would be awesome for cleaning up the shipping sector.
One little snag here is of course that while small reactors are going to be safe, they can be made unsafe rather easily by slapping some explosives to them. You say small reactor, I say dirty bomb waiting to happen. They're kind of hopeless from a safety point of view unless you keep them in a maximum security facility. That makes using them rather expensive.