Tuesday’s primaries in Virginia, North Dakota, Nevada, South Carolina, and Maine indicated that in many congressional races, vehemently attacking President Trump will not be a winning strategy for either Democrats or Republicans in the Nov. 6 general election.

As we’ve seen in earlier primaries this year, it was clear Tuesday that while strongly resisting President Trump is certainly damaging to Democrats, doing so is nothing short of catastrophic for Republicans. GOP voters in several races showed once again that they are rejecting lawmakers who decisively break with the president.

Instead of building their campaigns on being anti-Trump, candidates in both parties would be wise to develop compelling moderate policy alternatives and a unifying message that can appeal to centrist and independent voters.

The most prominent Trump critic to go down to defeat in the Tuesday primaries was Republican Rep. Mark Sanford in South Carolina’s 1st District. Sanford lost his GOP primary for another term in the House to state Rep. Katie Arrington, a strong supporter and defender of the president.

Instead of building their campaigns on being anti-Trump, candidates in both parties would be wise to develop compelling moderate policy alternatives and a unifying message that can appeal to centrist and independent voters.

President Trump endorsed Arrington in a tweet just three hours before the polls closed, while at the same time offering harsh criticism of Sanford, a former governor who resigned after admitting an extramarital affair with a woman in Argentina. The president’s tweet attacking Sanford said that “He is better off in Argentina.”

It is worth noting that though backing President Trump helped a number of Republican candidates in Tuesday’s primaries, South Carolina Gov. Henry McMaster’s past endorsement of President Trump was not enough to help him break the 50 percent threshold needed to avoid a runoff later this month.

Tuesday’s results were arguably encouraging for Democrats in several races, especially in Virginia, where a number of promising Democratic candidates secured their party’s nominations.

In Virginia's 10th Congressional District in the northern point of the commonwealth, moderate Democrat Jennifer Wexton coasted to victory in her primary race and will now face Republican incumbent Barbara Comstock in November.

Given that Comstock’s seat is one of the more vulnerable Republican-held seats nationwide, Wexton’s victory is a particular bright spot for Democrats looking ahead to the general election.

Wexton is a moderate, anti-resistance Democrat who certainly has broad appeal and a strong opportunity to defeat Comstock in November, despite the district’s historically Republican voting record.

In Virginia’s 2nd Congressional District in the Tidewater region along the Atlantic Coast, Democrat Elaine Luria, a former Navy commander and small business owner, won the Democratic primary. Luria will face incumbent Republican Rep. Scott Taylor, who is also a veteran, in the general election.

Luria has received support from Democrats nationwide as the party has focused on this particular district as a top target in its effort to regain control of the House. Luria’s credentials as an accomplished veteran and her moderate policy views underpin her strong positioning heading toward November.

Additionally, former CIA officer Abigail Spanberger won the Democratic primary for Virginia's 7th Congressional District, which is another key district Democrats are targeting to flip.

It is certainly notable that the winners of these three congressional races in Virginia – Wexton, Luria, and Spanberger – are all women. This is especially significant for Democrats heading into November, as the presence of strong, moderate female candidates – all positioned differently than the insurgent resistance movement – may serve to revitalize the blue wave that Democrats hope comes to fruition.

If Democrats stand any chance at taking back congressional seats in November while likewise holding onto vulnerable congressional seats currently held by their own party, it is necessary that the party’s message emphasizes centrism and unity.

This will be especially important as Democrats attempt to flip Republican Sen. Dean Heller’s seat in Nevada and retain Democratic incumbent Sen. Heidi Heitkamp’s seat in North Dakota.

Democrat Jacky Rosen will take on Heller in what will certainly be one of the most closely analyzed Senate elections in November. Democrats know that defeating Heller, in a state Hillary Clinton won in 2016, is essential if they stand any chance at taking back the Senate or stemming potential Republican gains.

In North Dakota, a state that Donald Trump carried by nearly 36 points in 2016, Rep. Kevin Cramer won the Republican nomination for Senate to challenge Heitkamp.

Candidates in both parties on the ballot in November need to remember that voters want to know not just what the candidates oppose, but what they are for. Simply complaining about President Trump without giving voters a compelling reason to support them will be a losing strategy.