In the middle of the 20th century, things moved quickly. In January 1942, a group calling itself the United Nations declared for mutual support during the Second World War. If you look closely at the declaration, you can see China’s signature, between Russia and Australia and just down from Britain and, signed by FDR, the US.

China at this time was the Republic of China; 30 years before it had come into existence under Sun Yat-Sen. The Republic was the China that signed up for the “real” post-war UN and the China that accepted the Japanese surrender of the island of Taiwan in 1945.
Four years on in 1949, the Republic of China was no more than the same island of Taiwan, and the other signatories to the 1942 document had to re-think allegiances.
The US would take two more decades, and its presence kept the People’s Republic of China out of the UN until 1971.
The UK, on the other hand, didn’t need time. It had written the textbook on realpolitik centuries before the Treaty of Westphalia, let alone the creation of the USA, and let alone the creation of the PRC.
So it was that on 6 January 1950, a bat’s wink of three months and six days after the PRC declared itself the legitimate China, the UK accorded it diplomatic recognition. As Churchill had observed in the Commons seven weeks earlier:
The reason for having diplomatic relations is not to confer a compliment, but to secure a convenience.