When Donald Trump first took office in 2017, officials in Beijing saw a pragmatic businessman: All that tough campaign talk, they argued, was merely "Art of the Deal" negotiating tactics rather than deeply held beliefs.

Yet more than two years later, Chinese President Xi Jinping finds himself on the verge of a new cold war his government sees fanned by Washington's most ideological China hawks. What's worse, the view that China is a strategic competitor that must be thwarted at all costs is picking up supporters across the U.S. political spectrum by the day.

As Trump continues to raise the stakes with threats to kneecap Huawei Technologies Co. and other companies over what the U.S. says are rising national security risks, officials in Beijing are weighing their options to respond. They are stoking up anti-U.S. sentiment and drawing up contingency plans to bail out Huawei, while also still calling for dialogue to resolve the dispute.