Earlier this month, as temperatures topped 100 degrees and homeowners and businesses cranked up their air conditioning, Texas’ grid struggled to cope with the record demand for electricity. The heat wave was compounded by a loss of power from thousands of wind turbines that couldn’t function on days when not so much as a breeze was blowing. Predictably, energy costs skyrocketed in the Lone Star State.

In Houston, as peak electricity demand climbed to record levels, wholesale power prices spiked virtually overnight by an astounding 49,000% (to $9,000 per megawatt-hour). The operator of the electric grid, the Electric Reliability Council of Texas (ERCOT), warned that reserve margins were so dangerously low that it might have to institute rolling blackouts. ERCOT called for the construction of more gas-powered generating plants.

Yet, a number of states, most notably California, want to push natural gas out of the picture, putting residents on a collision course with reality.

No one should think that the days of burning natural gas for electricity production are numbered, or that gas has been overtaken by solar and wind. America’s vast gas reserves and the development of combined-cycle power plants, using gas and a steam turbine to generate 50% more electricity than traditional gas plants, together with advanced designs and better efficiency will keep natural gas in the energy picture for decades to come.

According to the Energy Information Administration, natural gas currently meets 28% of U.S. energy demand, while about 24% comes from coal and 11% from renewables.

Natural gas is among our cheapest energy sources. As more and more gas-fired power plants replace coal-fired plants, it is also having a significant effect on the environment, reducing power-plant emissions by 50% more since 2005 than wind and solar power combined.

The trend will continue. Two hundred and eighty coal-fired plants, more than half of the U.S. coal fleet, have either closed or announced plans to close since 2010. Time is running out for the remaining 240 coal plants. But lawmakers in several states aren’t satisfied with the progress and are now campaigning to leave gas in the ground.

Take California. A new mandate even more ambitious than California’s Renewables Portfolio Standard commits the state to achieving 100 percent zero-carbon electricity by 2045. Nine other states, including New York, Washington, New Mexico and Hawaii, have set the same target or are considering it. Natural gas might have no political future in those states.

Such measures are ominous because the nation needs more, not less, natural gas to fill the gap left by the closure of coal and obsolete nuclear power plants. The danger of not having enough baseload power has already become evident in Texas, California and New England. Serious challenges facing grid reliability have emerged, particularly in Texas, where wind energy accounts for about one-fourth of the state’s generating capacity.

While wind and solar generating capacity continue to increase—hitting new records in 2018—policies mandating the phase out of natural gas ignore the limitations of these sources of energy.

Increasing reliance on renewables may sound good environmentally, but neither the sun nor the wind can provide reliable “baseload” capacity that can be dispatched, as needed, when it is abnormally hot or cold. Gas plants, on the other hand are uniquely capable of ramping up quickly and hit maximum output in a matter of minutes, keeping the lights on and air conditioners humming. Looking ahead, we’ll need more natural gas, not less.

Fortunately, more than 15,000 megawatts of new combined-cycle natural gas generating capacity—enough to power as many as 4.5 million homes 24/7—is scheduled to begin operating nationally by 2020. Stopping or delaying those additions to the grid are recipes for brownouts or blackouts.