President Trump seems to think that his hard-line immigration stance is a political winner, s aying he’s willing to keep much of the government shut down in order to get funding for his border wall. Polls suggest voters don’t see this Mr. Trump’s way, and blame him, not the Democrats, for the impasse. With Democrats taking control of the House of Representatives on Thursday, he now has the excuse he needs to make a deal.

But if he doesn’t compromise, if he instead continues to try to transform his once proudly pro-growth party into the anti-immigration party, he will threaten Republican prospects for a generation.

November’s midterm elections provided a clear indication that Mr. Trump’s strident positions on immigration were not widely popular. Ignoring the pleas of top Republicans, the president made the elections a referendum on the issue, vowing to end birthright citizenship, sending the military to deal with a caravan of asylum seekers and championing fringe legislation to cut legal immigration in half.