Editor’s Note: Joshua P. Meltzer is a senior fellow in the Global Economy and Development program at the Brookings Institution. The opinions expressed in this commentary are his own.

President Trump has been right to focus on the economic and trade challenges China presents to the United States. But his approach risks producing a deal with only short-term wins and enormous longer-terms costs.

Earlier this month, the United States imposed 25% tariffs on $200 billion worth of imports from China and is threatening tariffs on an additional $325 billion in Chinese goods. China retaliated, promising to raise tariffs further on $60 billion in US exports.

Dealing with China is the defining challenge for the global economy. China cuts out exports and investment from the Chinese market, steals intellectual property (IP), forces businesses to transfer technology and subsidizes its companies. This gives Chinese firms an unfair competitive advantage. Such tactics are either difficult for the World Trade Organization (WTO) to police, or, in many instances, the organization’s rules don’t cover such behavior. The case for US leadership here is clear. China claims that a new law will aim to curb these practices, though many are skeptical of its effectiveness.

But a successful deal between the United States and China must include reforms to China’s own subsidization strategy and the role of state-owned enterprises, improved IP protection and the free flow of data. Making progress in these areas was always going to be hard. There are enormous vested interests in the status quo in China, and reforms could affect the Chinese Communist Party’s control over the economy.

Yet the president has entered the fray unprepared and unnecessarily handicapped. The administration failed to prepare the United States for the duration or cost of the challenge. It has unilaterally disarmed itself by withdrawing from the Trans-Pacific Partnership (TPP), and gratuitously hurt allies such as the EU, Japan and Canada by raising tariffs on their goods — the tariffs on Canada were just lifted — and hurling personal insults, making it harder to form a united front on these China trade issues.

To extract the best outcome from a trade deal with China, President Trump should rejoin the TPP (now the CPTPP). If instead of withdrawing, Trump had pushed Congress to quickly ratify the agreement, he could have then focused on expanding the membership to include the likes of South Korea, Thailand and Indonesia, which were all interested in joining. Such a trade deal would have placed significant additional pressure on China to reform. Why? Under TPP, shifting supply chains outside of China would have given companies preferential access to the US market. Moreover, the TPP already included the types of rules the United States is demanding from China — such as limits on operating state-owned enterprises and subsidies, and commitments to the free flow of data.

Second, pulling out of TPP kicked off the pain now rippling through the US agriculture sector, as American farmers missed out on the preferential access that their Australian and Canadian competitors — TPP members — have in Asia, including Japan. Trump’s tariffs on steel and aluminum compounded US farmers’ pain; Chinese retaliatory tariffs on US agriculture exports upped the costs even more. Some of this Chinese retaliation was inevitable as the US raised tariffs on China, but the costs would have been less if American exporters had alternative TPP markets. This matters not only for agriculture — it also increases political pressure on Trump to do a deal, something the Chinese will use to their advantage.

President Trump also needs to accept that reducing the US-China trade deficit will do nothing for America’s overall trade deficit with the rest of the world. Trump’s negotiators have been wasting political capital on the bilateral deficit with China at the expense of making progress where it matters. Specifying which goods (soybeans, for example) and how much China needs to purchase as part of a deal is not how market economies operate. Instead, it constitutes the sort of managed trade practiced by China. Having China purchase more US goods will also come at the expense of other countries selling to China, including US allies. Finally, because such an outcome only grants preferential treatment to the United States, it is in breach of China’s WTO commitments.

Confronting China is the key trade issue of our time. Yet the current approach risks selling the United States short and not achieving key goals, all the while undermining the WTO and harming US allies.

Correction: An earlier version of this article incorrectly stated that the United States' WTO commitments would be breached were it to force China to purchase more US goods.