Why does the ANC align itself with Zanupf publicly

The challenges in Zimbabwe appear to have an adverse effect on South Africa socially as shown by the recent targeting of foreign nationals at hospitals by operation dudula. Yet senior ANC officials were amongst the first to congratulate Zanupf in the recent elections and have been reluctant to publicly condemn some of the actions of the Zimbabwean government. Why doesn’t the ANC seemingly work against their own electoral interests on this issue?