A Sudanese sister who I occasionally interact with on Twitter posted something about the problems of understanding Africa-Chinese relations through a Western lens. I offered the following as a response.
The relationship between China and Africa is complex due to its longevity. Prior to the formation of Western hegemony, and extending back to the very distant past, trade relations existed between the two.
During the decolonization movement, China became an ally of African independence struggles and, more broadly, a signifier of Black revolutionary struggle even in the US.
We can consider the so-called era of globalization as the third and most recent stage of African-Chinese relations, wherein the imperatives of global capitalism and the need to counter Western hegemony has re-patterned this relationship in exploitative ways.
There are several dimensions to be mindful of. These relations have been shaped by (1) internal developments in both African & China, (2) broader regional and global dynamics, and (3) the context of global capitalism and the context of neocolonialism.
As to the issue of Chinese anti-Black racism, it should be noted that China is a multi-ethnic society and that there is a history of discrimination against non-Han groups within China such as Hakka, Uyghurs, and Tibetans. Much of this history is quite violent. In addition to this, there is evidence of negative perceptions of Africans from over a thousand years ago. Perhaps this was derived from Chinese contacts with the Arabs or domestic and pre-existing prejudice. Furthermore, there were enslaved Africans in China, but it should be noted that this was not the chattel slavery instantiated by the West centuries later.
Below are some sources for further reading: