That is apparently a myth.
Even if it is a myth (the voter registration records from that era are long gone, I am sure), the “modern” democrats have manipulated the narrative so much that people FORGET that The Republican Party represented Civil Rights legislation, Lincoln, Freedom, the Emancipation Proclamation, etc.
The democrat party, on the other hand, represented the “Dixiecrats”, Jim Crow, the KKK, and the Vietnam War.
I am old enough to remember (But so so old as to forget) Bull Connor, Lester Maddox, George Wallace, and the 1968 Convention, all democrats.
I was just a kid at the time, but I remember Nixon running as a “Peace” Candidate. Not as extreme as McGovern or McCarthy, but definitely as a repudiation of the policies of LBJ.
So, the perception of MLK as a Republican is not as far fetched as it would seem by today’s sensibilities.
If it is a myth...so be it. But it would have made sense at the time.