This is not entirely true. The Qing dynasty ruled Taiwan for some two hundred years until Japan took it in the first Sino-Japanese war. It returned to Chinese control in 1945, and then there is the whole communists vs nationalist with the ROC fleeing there in 1949.
That being said, China can’t have Taiwan. It’s too strategically important to the US, and I dare say worth going to war over if they invade.