Two things seem certain in modern presidential campaigns: Candidates will spend more time attacking each other than offering constructive alternatives, and one or both will attack China.

In 1992, Bill Clinton accused President George H.W. Bush of coddling Chinese dictators. In 2004, John F. Kerry assailed “Benedict Arnold CEOs,” and by extension their allies in President George W. Bush’s administration, for shipping jobs to China. Now, Mitt Romney is challenging President Obama by pledging that if elected he will “on day one” label China a currency manipulator, crack down on Chinese “cheating” on everything from intellectual property violations to trade practices, and determine what should be cut from federal spending based on whether it merits “borrowing from China to pay for it.”

More than ever, these attacks are counterproductive, distort a robust and ever more entwined China-U.S. economic relationship, and distract from the real challenges facing U.S businesses, which have little to do with China and everything to do with the continued viability, competitiveness and innovation of the American economic system.

China is a larger and more important market for U.S. companies than ever. Even as the pace of growth in China moderates, Chinese consumers flock to U.S. brands as diverse as KFC and General Motors, Intel and Walmart, IMAX and iPhones.

If you ask, many executives will say it is easier to do business in China than it was a decade ago (though harder than it was five years ago) and is still much more straightforward than in many other parts of the world, such as India. For Americans in general, however, views of China are amplified by anxiety about the slow economic recovery in the United States. A more confident America in the mid-2000s was less troubled by hurdles to doing business in China than a more anxious America is about lower — but still formidable — hurdles today.

The best that can be said for American hostility to China is that is it bipartisan. Not to be outflanked by Romney, the Obama administration has intensified its pressure on Chinese trade and investments. It halted the purchase of wind farms in Oregon by Ralls, a Chinese-owned company, because the proximity of the farm to a naval facility could enable Ralls to “take action that threatens to impair the national security of the United States.” It was the first time in 20 years such a justification was used to halt a Chinese purchase.

Such opposition is in sync with Washington’s hard line about Chinese purchases of U.S. assets, notably the storm of criticism in Congress of the Chinese telecom giants Huawei and ZTE. Huawei is contemplating a public offering on Wall Street but has run into a gantlet of rhetoric from Democrats and Republicans that paints the company as something just slightly better than the arms manufacturer Krupp at the height of Nazi Germany.

This is hardly the first time such a storm has erupted in Congress. In 2005, Chinese energy company CNOOC was forced to withdraw its bid for California energy company Unocal after a similar uproar about dark threats to national security. CNOOC’s current $15.1 billion bid for Nexen, an oil and gas explorer, has drawn unusual scrutiny both in the U.S. and in Canada.

China has its own anti-American narrative. In public polling, large numbers of Chinese say they believe that the United States wants to impede China’s economic rise and that Washington is motivated not by a desire for a level playing field, transparency and the rule of law but by a thinly veiled imperialism that seeks to contain China, prevent it from becoming a regional military power and undermine its emergence as a global economic giant.

To be sure, the climate has grown more chilly in the past year or so. Many Americans doing business in China tell stories of less-genial relations with business partners, more rules designed to slow the pace of investment and deals, and increasing government favoritism of Chinese enterprises over American or other foreign competitors.

To which the reply should be: So?

What country in history has preferred foreign competition to domestic enterprises — except perhaps for purely trading states such as Singapore or the Hanseatic League of days past? What country does not have a web of regulations and preferences that create hurdles to foreign entry, whether explicit or implicit?

Yes, the United States is open to foreign investment, but like most countries only to a point. The U.S. government restricts foreign ownership of airlines, telecommunications and energy, as does China and almost every other country in the world. But China is far more open to investment than India, Indonesia or even Brazil, all democracies but still deeply suspicious of the negative consequences of too much foreign involvement in their domestic economies.

Even more, the U.S.-China trade relationship has blossomed in spite of misgivings and rhetoric. Imports generate hostility in the U.S. as a symbol of lost jobs and China’s outsize influence. But while imports from China have grown from $321 billion a year in 2007 to an estimated $480 billion in 2012, U.S. exports to China have proportionally grown even more, from $62 billion in 2007 to a projected $120 billion this year. So while the trade deficit has increased (as have the size of the U.S. and Chinese economies during the past five years), China as a market for U.S. companies has grown much more significant.

Even that import figure — large and attention-grabbing as it is — distorts the imbalance, because many of those are goods produced in China by U.S. companies.

Take the controversial case of Apple making its phones and tablets at Foxconn factories in Shenzhen. Labor issues at those plants have come under intense criticism. But the reality is more complicated, given that wages at those plants are well above average for Chinese workers and that Foxconn’s managers have been more transparent and more responsive to international criticism and pressure than American companies were in the company-town days of the late 19th and early 20th centuries, or many Mexican companies were during the brief heyday of the maquiladoras in the 1990s. That is no excuse for abusive labor practices, but the issue of labor conditions speaks as much to American ambivalence about sourcing in China as it does to actual conditions at these factories.

As for who benefits from the trade, when those phones enter the port of Long Beach, Calif., they show up as imports from China. But only a fraction of the stated value actually goes to China. The full retail price of the iPhone 5 may be $649, but manufacturing costs are less than $10 per phone. Components are another $200, and most of those revenues go to U.S. and foreign tech firms such as Texas Instrument and Infineon that produce the designs and intellectual property.

You can do similar calculations for Nike shoes, Coach bags and Walmart supplies. Of the $13.5 billion in Nike footwear sales in fiscal 2012, a third of the shoes were made in China, at a cost of about $1.8 billion. In short, a huge portion of U.S. imports from China benefits not China but U.S. companies.

Whether they benefit U.S. workers is a heated and legitimate question, to which the answers are mixed. U.S. manufacturing jobs have been lost over recent decades, first to Taiwan and South Korea and Japan, then to Mexico in the 1990s, and to China in the 2000s. But today, U.S. manufacturing is shipping high-end goods to China. That hasn’t replaced lost jobs, but it has slowed their decline.

Then there are charges against China of discriminatory practices, rampant theft of intellectual property and no reliable rule of law. All of those have merit, but given the degree of economic entwinement, the United States can only do so much. It can engage in tit-for-tat retaliation, but both Chinese and Americans eventually recognize that only harm to both sides ensues. The ongoing U.S.-China Strategic and Economic Dialogue, begun under the George W. Bush administration and accelerated and deepened by Obama and Secretary of State Hillary Rodham Clinton, provides a regular and effective forum to air grievances. Because it is an election year in the U.S. and a regime-change year in China, little movement has occurred, allowing pressures to build.

Ultimately, what is framed as contest between the United States and China will be determined not in courts of law adjudicating patents, not by the World Trade Organization hearing complaints, and not by Chinese ideologues or Congress and the White House alternating platitudes with injunctions. It will be determined by the vibrancy of each economic system.

If American companies such as Apple continue to invent and produce devices that enrich individual lives and enthrall consumers young and old, they will find riches in China.

If American entrepreneurs and businesses large and small continue to offer solutions that everyone wants and needs — whether new ways of producing energy, more efficient ways of manufacturing goods or better systems of management — then the Chinese will do what they have been doing for two decades: be a partner and a market.

If China accumulates dollars based on the flow of trade, and if America remains a place where investments are transparent and markets are attractive, those dollars will flow back into the United States, perhaps in the form of buying Treasury securities but far more preferably in the form of China investing directly here. It already has, and mayors and governors across America shy away from the rhetoric of Washington because they recognize how needed, valuable and potent such investment is.

Whether China is a long-term threat, therefore, has as much to do with choices made by Americans as decisions made by the Chinese. Americans can only marginally affect what China does, but Americans can maximally determine the future arc of the United States.

If innovation is nurtured and a sense of optimism about the limitless possibilities of the future is maintained, then China represents only more of an opportunity for U.S. prosperity. You wouldn’t glean that from the content of the debate, and it’s possible that if today’s harsh words translate into tomorrow’s harsh policies, the relationship will be damaged so severely that those opportunities evaporate. We are not there yet, by a long shot, but it would be better to steer in a different direction before we end up somewhere we do not want to be.

American prosperity over the next decades will not be determined by decisions made in Beijing or by China’s political and social peregrinations. It will be shaped by how America approaches the global economy of the 21st century. If the U.S. focuses on nurturing the optimism, drive and skills that yielded such results in the 20th century, it will thrive; if Americans obsess about looming threats from the East, it may indeed enter the economic twilight. The choice is ours.

Karabell is president of River Twice Research and the author of “Superfusion: How China and America Became One Economy and Why the World’s Prosperity Depends on It.”