I'm under the impression that time is actually working for China and that they don't really require a war; they'll catch up economically soon enough (5-10y) that a war doesn't benefit them at all, and only the US would benefit from one right now, while they still have a chance of nipping their primacy in the bud.
I think we're currently starting to see behind the facade of Chinese economy news. It's not all rosy.
But also: For China, Taiwan is only to a very limited extent about the economy. It is about ideology. For the US, a war now would be a bad idea - only slightly better than it would be a little later. There's an increasing gap in naval abilities (that'll - so the Pentagon thinks officially - close in the 2030s)
That means that we're currently in an unstable time. War is possible, but not a given. Meanwhile, if war happens, the US can't fight on three fronts. And so both Ukraine and the mideast conflicts strengthen China's hand if it comes to war, and weaken the US's. Similarly, an independent EU with at least some manufacturing capability lessens US constraints.
At the moment, things are all about shaping the odds.
If Nationalism weren’t a factor, there is essentially zero reason for the PRC to ever invade Taiwan.
Nationalism is a factor and the PRC is a totalitarian dictatorship. They’re going to go after what they consider their “rogue province” sooner or later, and whether it benefits them economically or not is a footnote.
Them being a totalitarian dictatorship doesn't necessarily mean they're stupid. I doubt they would risk their economy just because of Taiwan. They may go after it at some point in the future when the odds are in their favor (because they're obviously not right now), but I doubt it'll be soon.
This, and to reinforce this: two things tend to happen with dictatorships: they either face a succession crisis at some point which brings it to its knees, or the existing guy becomes less rational in his old age after a few decades of being surrounded by bootlickers.
The PRC has actually managed to successfully stave off a few leadership crisis’s already, but one of the ways they did so was by moving away from a dictatorship of one and establishing term limits and a model that encourages leadership to think about the next generation and ready a successor. Xi Jinping just re-established a dictatorship of one with an unlimited term length and will presumably serve as the PRC’s strongman dictator for the rest of his natural life creating new opportunities for a succession crisis or for himself to just fall prone to old age. He wasn’t shy about killing off anyone that could have challenged him during his initial election to Premier and associated offices, we have no reason to think he’ll be any different than any other tinpot dictator in history and kill off anyone that looks like they might be gathering too much influence under his rule or looking just a little too eager to be his successor.