First, the specific claim was that Republicans invoked "states rights" to oppose the Civil Rights Acts, which is just demonstrably untrue.
Second, we're talking about the 1960s, not the 1860s. By that time, the Democrats were already the party of FDR and JFK, and Republicans were already the party of Richard Nixon. JFK won the Carolinas, Georgia, Arkansas, Louisiana, and beat Nixon in Alabama and Mississippi, because it was perceived that he had a poor record on civil rights.
The idea that the “party labels flipped” is just blatant historical revisionism. By the 1950s and 1960s, Democrats were the party both of African Americans (who switched from Republicans during the FDR era), the War in Poverty, and southern segregationists. What happened is that, at some point, support for outright discrimination became unviable, and the battle front moved to other issues, such as affirmative action. That naturally fit into Democrats’ willingness to use the power of government to address social inequities.