The youngest white voters are more evenly split between parties. About half of whites ages 18 to 24 say they’re Republicans. They favored Mr. Trump in the presidential election, but those who turned out in the midterm elections very narrowly backed Democrats, according to preliminary data from Catalist, a Democratic data firm. And only 39 percent of 18-to-24-year-old whites approve of President Trump, the Pew data shows.

Also, this next generation (those born after the mid-1990s, the so-called Generation Z) will be the first in which nearly half of the electorate is nonwhite — a group that overwhelmingly votes Democratic.

“Republicans are in trouble,” said Kristen Soltis Anderson, a Republican pollster who has written a book on millennial voters. Election results show millennials holding onto their Democratic views as they age, she said. “It would not surprise me if the problem is worse, not better, with Gen Z, given the moment we’re in.”