The Bernie Sanders-led “democratic socialist” faction is thriving, but the Democrats must remain a big-tent party to achieve their goals. AP

Democrats obviously performed very well in the US midterm elections. More importantly, they now appear to have a clear path to regain the White House in two years, if they pick their battles wisely.

They will now face a familiar dilemma. Do they embrace their ideological impulses and reward their base by shifting radically to the left, or do they make the compromises necessary to ensure that they remain a “big tent” grouping that can appeal to moderates − and even some conservatives − and therefore win nationally?

If they can resist being co-opted by an angry base, their chances of regaining the White House in 2020 are starting to look quite strong.

While the initial results on election night caused many who were hoping for a “blue wave” repudiation of President Donald Trump to feel disappointed, in fact Democratic gains are very much in “wave” territory.

With the final results still coming in, they appear on track to have gained at least 35 seats, an impressive performance by almost any standards.

Republicans may increase their Senate majority by one or two votes, but given the extremely disadvantageous Senate election map they faced this year, Democrats actually did well to hold their losses to such a limited level.

Indeed, given the large number of seats they had to defend in states that voted enthusiastically for Mr Trump two years ago, it’s remarkable they didn't lose more.

But looking forward to the 2020 effort to regain the White House, particularly given that Americans have a solid pattern in recent decades of re-electing even decidedly mediocre sitting presidents, the party has to be concerned.

Mr Trump has a firm hold on his own base, strong support in many rural and exurban areas, which are disproportionately powerful in the presidential electoral college, and, at least as things stand now, can certainly try to take credit for a strong economy.

Democrats are mesmerised by their inroads in several traditionally conservative “red” states, such as Georgia and Texas, where they narrowly lost hotly contested elections. The idea of an African-American woman winning the election for governor of Georgia, as Stacy Abrams nearly did, was deeply inspiring to many Democrats.

“Flipping” traditionally Republican red states across the South and the Bible Belt is extremely appealing emotionally.

However, the crucial fact is that Democrats don’t need to perform such relative political miracles in order to retake the White House in 2020, although they certainly could.

As the noted political commentator William Galston has pointed out, there is a much simpler and more logical path for the Democrats in the next election. Three Midwestern states that have frequently voted Democratic in the past are the key.

Begin with the assumption that Democrats can hold onto all the states that Hillary Clinton carried in 2016. Mr Trump and the Republicans don’t seem to be increasingly competitive in any of them at this stage.

Even concede that Mr Trump can again prevail in crucial swing states, such as Florida and Ohio, which seems entirely plausible.

Nonetheless, all the Democrats would need to add to Mrs Clinton’s 2016 performance are victories in Pennsylvania, Michigan and Wisconsin. Together, they provide 46 additional electoral college votes, which is enough to regain the White House.

Ohio seems to be consolidating as a Republican state, and Democrats certainly can’t count on winning Florida against Mr Trump.

But if they focus on Pennsylvania, Michigan and Wisconsin − and the blue-collar and unionised voters there who were seduced by Mr Trump two years ago − they could beat him.

Democratic candidates performed very well in all three states in the midterms. A key reason is that Mr Trump’s main achievement so far has been a large tax cut for the wealthy and corporations, at the expense of working people.

Mr Trump could complicate this if he resurrects his idea of a trillion-dollar infrastructure public investment, which would create large numbers of jobs. But he’s shown absolutely no sign of it, and could face stiff resistance from conservative Republicans, and possibly Democrats, if he did try.

For now, he seems focused on staging poisonous fights over race and culture. Such white-nationalist fear mongering works in many parts of the country, but probably won’t be sufficient in these Midwestern states.

The biggest obstacle for Democrats could be an ideological shift too far to the left. The Bernie Sanders-led “democratic socialist” faction is certainly thriving.

However, around the country in the recent election, Democrats showed an encouraging willingness to tailor nominations to suit local preferences, running left-leaning, centrist and even slightly conservative candidates where that proved most effective.

A presidential nomination, though, is more complicated. That person will be a national leader, and Democrats may well have to endure a bitter struggle between the left and the centre.

However, the election result they just secured in the face of a prosperous national economy suggests that if Democrats can remain open to a wide range of orientations, nominate a candidate with broad appeal, and focus their energies on Pennsylvania, Wisconsin and Michigan, they can make Mr Trump a one-term president.

Hussein Ibish is a senior resident scholar at the Arab Gulf States ­Institute in Washington