Nor is technology a big concern. Only 9 percent of Trump supporters are worried that their job will become obsolete as a result of technology compared with 15 percent of those who don’t approve of the president.

Likewise, exposure to trade competition played no apparent role in persuading Obama voters to switch to Mr. Trump. People who voted for President Obama in 2012 accounted for about 12 percent of all Trump voters, but again, these voters were not disproportionately involved in the manufacturing sector, either nationally or in swing states. Around 8.7 percent of Trump voters who also voted for Mr. Obama in 2012 work in manufacturing, compared with 9.5 percent of Trump voters who voted for Mitt Romney.

Exposure to trade is even less important for far-right voters in Europe than it is for Trump voters. Using data from the European Social Survey, I find that working in manufacturing raises the probability of voting for a far-right party in the most recent election by less than one percentage point, using no demographic control variables. Adding the same controls as above — religion, race, age, education, gender — eliminates even that small effect.

As in the United States, European far-right voters were far more likely to express concerns about immigration and race, saying, for example, that they are discriminated against, or that being white should be an important factor in determining whether foreigners are allowed to migrate.

By contrast, voters reporting positive interactions with people from other races were much less likely to be far-right voters.

None of this is to say that economics is unimportant to nationalist voting. Both Trump voters and European far-right voters are distinguished by their strong dissatisfaction with the present state of the national economy, even controlling for demographic factors and attitudes on race and immigration.