If you are very very lucky you can spot this kind of behavior (not always), and it helps to keep your distance from those kinds of people. Not being rude or mean to them, but not letting them get close enough that they can use you to disguise their racism or just to feel good about themselves.
I fell into this trap too, when I was much younger and more naive, but learned over time to spot the kinds of women who had no other friends of color (and you never see them interact with other PoC) but are extra super friendly to you, but don't seem to care about your activities, have questions about your life, your family, or your thoughts about anything. When you look back and see that their "friendship" was entirely performative, with no real feelings for you behind it.
Hindsight is 20/20 they say.