This most happen because of economics. But, people are leaving BLUE cities and states ij droves and are buying houses for way over asking price—I don’t see this slowing down much.
Sellers in red areas should require an addendum to the contract of sale in which the buyer swears not to register or vote Democrat, so the neighborhood is not ruined.
Back in the bad old days (way before I was RE licensed) when Jim Crow was for real there were towns and neighborhoods where part of the contract was a promise not to sell to blacks.