MIDDLETOWN, Pa. — Sandy Sinkovich, a retired X-ray technician, was a registered Republican until she switched parties during the Obama years. She plans to vote a straight Democratic ticket in the midterms. President Trump, she said, has “done nothing but destroy our country.”

Dave Sweeney, who services juice machines, registered as a Republican in 2016 after years of being a Democrat so he could vote for Mr. Trump in the primary. He is concerned about the migrant caravan and plans to vote party-line Republican.

“No, I’m not racist if I think you should work for welfare, you should work for food stamps,” Mr. Sweeney said.

Few states have reflected the changing political allegiances of the Trump era more than Pennsylvania, which was the most populous of the trifecta of Rust Belt states that Mr. Trump flipped in 2016. Along the way, Republicans claimed 13 of Pennsylvania’s 18 House seats.