We need to deter China from invading for the period before internal problems (demography, debt, environment, and lack of avenues for further fast growth which is necessary to keep population content with dictatorship) either makes it a lot weaker, or makes it democratic, both of which is a good solution. It's not such a long time to wait - "peak China" according to most estimates is merely 10-15 years away so a generation from now, they will be less dangerous to us than they are today. Deterring them by at least making sure that invasion of Taiwan, even if likely to succeed, will not eventually worth it, is what we need and it's not all that hard to do. I'm sure Putin regrets invasion of Ukraine big time now and that's exactly the message we need to send Xi: "even if you can probably succeed, it's better to not try".
This is why Ukrainian war is very useful: it provides a reason to increase armament production capacity, which is being done now. That won't be possible in a democracy otherwise.