A spectator was also killed at the rally in Pennsylvania, the Secret Service said. Former President Donald J. Trump said in a post online that he had been “shot with a bullet that pierced the upper part” of his ear.
I'm going to withhold judgement at this time; there's a real chance that the motive was something like trying to start a race war. We'll probably know more an a day or so.
Apparently there are people who register as Republican just so they can vote in the Republican primary since Democrats never win there. So this fact alone doesn't really give much clue about motive.