From The Chinese Question: The Gold Rushes and Global Politics, by Mae Ngai (W. W. Norton, 2021), Kindle pp. 199-200:
THE IDEA OF RECRUITING Chinese to South Africa was not entirely novel. During the nineteenth century, nearly sixty thousand Chinese indentured workers labored on French plantation island colonies off the east African coast and in German, British, and French colonies on the continent. The Chinese presence in South Africa dates to the eighteenth century, when the Dutch East India Company shipped Malay and Chinese convicts from Batavia to the Cape Colony. During the 1870s and ’80s a few hundred Chinese artisans and workers arrived in the Cape Colony and Natal, along with greater numbers of Indians, contracted for infrastructure construction after the opening of the diamond fields. Voluntary merchant emigrants from southern China followed in their path. By 1904 there were 2,398 Chinese in all of British South Africa, more than half of them living in the Cape Colony. Chinese in the Cape worked mostly as small traders and also as cooks, carpenters, basket weavers, fish sellers, and wagon drivers.
There were hardly any Chinese in the former Afrikaner republics. The Orange Free State excluded Chinese from settlement altogether. The ZAR excluded from citizenship “any of the native races of Asia, including ‘Coolies’ [Indians and Chinese], Arabs, Malays and Mohammedan subjects of the Turkish Dominion.” It forbade Asiatics from walking on footpaths and pavements; from driving public carriages; from riding in first- and second-class railway compartments; and from buying or possessing liquor. The anti-Chinese laws of the former Afrikaner republics remained in place when power transferred to the British after the South African War.
Notwithstanding these restrictions and discriminations, Chinese carved out small niches in Johannesburg. By 1890 there were more than a hundred Chinese in the town, shopkeepers, laundrymen, and market gardeners; by 1904 the Chinese population of the Transvaal was about nine hundred. Chinese often did business in poorer white districts. Unlike white-owned shops, the Chinese sold at low prices, in small quantities, and on credit.
The Chinese in Johannesburg at the turn of the century followed the same patterns of social organization Chinese practiced across the diaspora. In the 1890s, they formed a huiguan called the Kwong Hok Tong (guanghetang) or Cantonese Club. It built a “clubhouse” on leased land in Ferreirastown, the original settlement of Johannesburg, which now lay at the city’s fringe. The house had several reception rooms, six bedrooms, a kitchen, and a latrine. Membership cost five pounds for initiation and dues according to one’s occupation. The club rented rooms at two pounds a month; kept a library of books and periodicals; and held social events and meetings that drew as many as 150 people. Yeung Ku Wan (Yang Feihong), a collaborator of Sun Yatsen who arrived in South Africa in 1896, formed a second group, the Xingzhonghui (Revive China Society). Photographs of members of both groups show educated men dressed in Western-style clothing.
Thus in 1903, when the idea of importing Chinese labor for the gold mines circulated, there was already a history of Chinese migration to South Africa and a small but established Chinese community in Johannesburg. These served as both precedent and warning—for both Chinese and whites.