The purpose of U.S. economic attacks against, including tech sanctions, is to bait and taunt China into retaliating. Certain advisors of the Trump administration believe that a compete decoupling is necessary to prevent China's rise, but the U.S. government itself does not have the power to force U.S. and other foreign companies to pull out of China. Ironically, only the CCP has that power (i.e. they can force out all foreign companies doing business in China, force Chinese companies to stop doing business with foreign countries).
Hence, China would be foolish to retaliate and turning on U.S. companies doing business in China because that is playing into the hands of Trump policy makers. Instead, China should further entangle itself economically with the U.S. and the West, making it even more difficult for the U.S. to attack China economically without shooting itself or allies in the foot. This is exactly what China is doing by opening up its financial system to U.S. banks and asset managers. The Trump Administration is trying to implement the same strategy from the Cold War, which is to isolate the enemy and apply maximum pressure externally so that the enemy implodes. The prerequisite of this strategy is a total economic decoupling and this this strategy can't work on China if China is too deeply entrenched with the West.
Also, these economic attacks by the U.S. aren't risk free, for example Trump's trade war has clearly backfired. If China retaliates, it could also very well backfire because its impossible to predict the long term consequences of such actions.