While I don't agree with the policy of confronting China militarily, they are far more formidable as a rival to the US than Russia is...
And that's exactly why it is in the interest of America to support (within NATO) Ukraine, because if they don't help and Putin takes Ukraine it may well send the message to China that it's ok to take Taiwan, because the Americans won't do anything anyway.
Well our arming Ukraine prior to 2022 didn't deter Putin so I see no reason to think arming Taiwan will deter Xi, China's ruler.
Nations typically do what they perceive as 'in their best interests' regardless of the consequences. Hence our invasion of Iraq in 2003 over the objections of many countries.
In the case of Taiwan, the only reason I see for China to invade is if Taiwan allows US or other foreign militaries to have bases on their land, or if Taiwan officially declares independence from China.
I don't really see how our spending hundreds of billions on Ukraine deters China. If anything, it encourages China given the fact that our aid to Ukraine limits how much aid we can give Taiwan. So right now would be a good time for China to invade Taiwan. But China, unlike Russia, is an ascending world power and has more to lose from a potential war. So in the near future, an invasion of Taiwan seems highly unlikely.