Its more complex than that. China allows Apple to freely operate and sell in China because apple is also deeply integrated in China's supply chain management and industry. She directly and indirectly employs tens or maybe hundreds of thousands of Chinese people and many Chinese companies are suppliers of apple. So if China cuts off apple she will be as impacted or maybe even more than the US. So it will be an own goal. CCP isn't that stupid I believe, propaganda aside. So China has as much to lose as well.
Moreover, the US can afford to do so since almost no Chinese brand is dominant in the US market or supply chain industry , so the US can easily cut them off without much repercussions. In this regard, the fact remains that the US is still the world's sole superpower and she leads/dominates in most technologies (chips, software, operating systems, aerospace etc you name it) and has allies who they can rely on to put pressure on any adversary, hence they have the luxury and can afford to act the way they want. Huawei's fate showed just how much power the US has over the world's technology.
China by contrast doesn't enjoy such a position as she is still a developing country trying to move up the value chain and become a high income status country . So she needs to be much more careful not to make mistakes that can jeopardise its rise and growth. Hence their more cautious approach even when the US is openly belligerent towards them , they still don't react that radically, compared to say hot tempered middle regional powers like say north Korea or Iran (they don't have much to lose as well, reason they act that way). So ultra nationalists here aside, the CCP has been more level headed not to think they can afford to act like a superpower like the US. They are not on the same level yet .
So to each his own.