President-elect Donald Trump has taken to Twitter recently to sound off on foreign policy issues.

China isn’t happy.

A story about Mr. Trump’s tweets posted this week on Xinhua, China’s state news agency, said Twitter should not be used as “an instrument of foreign policy.”

Get Breaking News Delivered to Your Inbox

“An obsession with ‘Twitter foreign policy’ is undesirable,” read the headline of commentary from Xinhua on Tuesday, according to a translation from the New York Times.

“Everyone recognizes the common sense that foreign policy isn’t child’s play, and even less is it like doing business deals,” the article said.

Mr. Trump has kept up a consistent pace on Twitter in recent weeks, posting 140-character missives on everything from Guantanamo Bay prisoners to whether he would have beaten President Obama in a hypothetical 2016 matchup.

His tweets also include frequent commentary on foreign policy -- and in the last month, a handful of those tweets have been directed at China. On Monday, he tweeted to criticize the U.S.-China trade relationship and to chide China for refusing to “help with North Korea”:

China has been taking out massive amounts of money & wealth from the U.S. in totally one-sided trade, but won't help with North Korea. Nice! — Donald J. Trump (@realDonaldTrump) January 2, 2017

That tweet prompted China’s foreign affairs minister to respond during a press conference the following day, where he said the “essence of China-U.S. economic cooperation and trade is mutually beneficial” and that China’s position on North Korea “is consistent and clear.”

And shortly before Christmas, he took to Twitter to accuse China of “steal[ing] United States Navy research”:

China steals United States Navy research drone in international waters - rips it out of water and takes it to China in unprecedented act. — Donald J. Trump (@realDonaldTrump) December 17, 2016

Earlier in December, Mr. Trump tweeted about China’s currency manipulation:

Did China ask us if it was OK to devalue their currency (making it hard for our companies to compete), heavily tax our products going into.. — Donald J. Trump (@realDonaldTrump) December 4, 2016

their country (the U.S. doesn't tax them) or to build a massive military complex in the middle of the South China Sea? I don't think so! — Donald J. Trump (@realDonaldTrump) December 4, 2016

Still, the Xinhua story recognized that tweeting is a “habit” for Mr. Trump, and something they did not expect to stop once he takes office.

“Issuing tweets has become a habit for Mr. Trump,” Xinhua said. Mr. Trump, the story said, “issuing hard-line comments and taking up sensitive issues” might help him in negotiating with other countries.