Those two things are not mutually exclusive.
A great many people in the US, Trump supporters certainly included, are experiencing uncertainty living in an economy in which the lifestyle earlier generations took for granted gets further out of reach every day - in which they find themselves ever further in debt with less all the time to show for it, and in which they're one catastrophic illness away from destitution.
Trump has cynically exploited that uncertainty by beating the racist, and especially anti-immigrant drum. People are primed to find somebody to blame for their misfortunes, and he's provided them with somebody.
And yes - to the degree that they've responded to his rhetoric, it's because they were already racist enough that when he led them in that direction, they willingly followed. So as far as that goes, yes - racism really is a driving force. But their racism isn't just some atbitrary thing that appeared out of thin air - for a great many, it's a specific reaction to a specific set of circumstances, and those specific circumstances are largely economic uncertainty.
It's sort of akin to people with chronic respiratory problems ending up hospitalized during a period of high air pollution, then other people arguing about whether to blame their respiratory conditions or the air pollution. Rather obviously, "or" is the wrong conjunction - it should be "and."
And by the bye - that whole dynamic is a good part of the reason that Musk and Thiel and many other billionaires are supporting Trump - because they and their actions comprise the lion's share of the real reason that that economic uncertainty exists, and Trump is not only determined to hide that fact, but to self-servingly make it so that they'll be free to cause even more harm.