Tesla Shanghai GigaFactory literally saved Elon's arse. You just need to pull out a daily TSLA chart for the past 4 years and compare it with SPY. Then you examine publicly known events of Tesla at pivot points in the chart. You get the picture without any third-party opinions or propaganda or FUD.
The original deal was a gamble from both parties. Shanghai is my home town where I still have lots of connections. Basically,
Shanghai has been looking to getting back to its previous glory as the #1 city in China after it missed Internet boom. Tesla wants scale out quickly and efficiently outside California (Fremont in particular). China is the place to be as far as EV is concerned: government support, addressable market, industrial supply chains, engineers and technicians, etc.
Tesla wants 100% control. Shanghai wants a cat fish with tax revenue potentials. So the deal is essentially Shanghai municipal government granted almost every wish of Elon (including full financing), while Shanghai gets guaranteed tax receipts in pre-defined time windows. The result was an out-of-the-ballpark surprise to all parties: Shanghai Giga started volume production in less than a year since ground breaking.
Elon becomes the richest dude on this planet. The rest is history.
So when you see Elon speaking nice about China on TV shows, don't be surprised at all. CCP literally has put tens of billions of $ in his pocket.