China would be shooting themselves in the foot by invading, because it would equally fuck them. I've read in may places that as soon as China invades, Taiwan will blow up all the fabs and supporting supply lines. So even if China takes control of Taiwan, the semiconductor industry will be a smoldering pile of nothingness.
This article[1] does a great job in describing why this would be the case. Even if China prevents the destruction of those fabs and factories, there would still be tons of obstacles.
[1]: https://doxa.substack.com/p/why-a-chinese-invasion-of-taiwan