Although China was technically 'communist' they were (and still are) operating in the grey area...
It was something like 30 years that the US withheld recognition...
If China did not help the US win against the USSR, we most likely still would not recognize the PRC. The CCP had to do something big to win trust.