When Donald Trump threatened on the campaign trail to deport every single immigrant living in the country illegally, bring back offshore drilling and reverse the anti-pollution policies that help clear smoggy skies, Californians immediately understood that our state would be disproportionately affected — and disproportionately harmed — by the reckless policies he was hoping to enact.

After he was sworn in, he went further, singling out the state for attack. “California,” Trump declared in February, “in many ways is out of control.” In one overwrought tweet, he suggested that the federal government should cut all funding for UC Berkeley because a protest against a conservative guest speaker had turned violent. A few days later, he declared — even more irresponsibly — that he would “defund” the entire state if he felt it wasn’t cooperating sufficiently in his efforts to root out undocumented immigrants.

Trump had already alienated many state voters with his plans to build a costly and unnecessary border wall, revoke the health insurance of millions of low-income people and gut climate-change policies. Now, he was taking on California itself, a state in which more than one out of 10 Americans live, and which sends more than $350 billion to Washington each year in federal taxes (and gets substantially less than that back). A state with strong progressive values that it will not happily see undermined.

Support our journalism Become a subscriber today to support editorial writing like this. Start getting full access to our signature journalism for just 99 cents for the first four weeks.

To express their dissatisfaction, hundreds of thousands of people gathered at rallies in the state’s major cities. One man’s quixotic California secession campaign became a cause célèbre. And California’s political leaders vowed to fight back.

Gov. Jerry Brown grumbled that if Trump cut climate data-gathering efforts, California would launch its “own damn satellite.” Legislators put former U.S. Atty. Gen Eric Holder on a hefty retainer to help challenge Trump’s initiatives in court even before he’d announced any. They filed a mountain of bills reacting to an array of reprehensible policies that the new president was thought to be considering. “We’re going to do what we need to do to protect the people of California,” said state Atty. Gen. Xavier Becerra.

“ An all-out war with the federal government is neither sustainable nor wise. The state will have to choose its battles. ” Share this quote

The initial response of state leaders — which included some good ideas along with a bit of flailing and a touch of panic — was understandable given the enormity of the threat. But as we settle in for the next four years, California needs to be clear-eyed about the challenges it faces and strategic about how it responds. An all-out war with the federal government is neither sustainable nor wise. The state will have to choose its battles.

For starters, California should continue to pursue its agenda on human and civil rights, on clean air, water and climate change, and on equality. Trump can dismantle the federal Clean Power Plan, but he can’t stop the state from moving toward its renewable energy goal of 50% by 2030 as laid out in SB 350 two years ago. The U.S. Environmental Protection Agency can reduce national fuel efficiency standards, but if it seeks to revoke California’s waiver that lets the state set its own, tougher rules, state lawmakers should fight back, including taking the agency to court if necessary. Trump can continue his counterproductive and mean-spirited efforts to deport non-criminal immigrants living in the country illegally, but the state’s local law enforcement agencies are not legally required to do the feds’ job for them; they should not.

California’s political leaders should reach out to other states — including red ones — to develop alliances on issues of common concern. Trump’s contempt for renewable energy resources, the reform of marijuana laws and the expansion of Medicaid, for instance, will surely alienate officials in other state capitols. Smoggy skies aren’t unique to Los Angeles, and western states have already shown interest in investing in renewable energy.

However, California lawmakers must also be careful about allowing the “resist at all costs” mentality to push them further than they ought to go.

Consider the biggest California vs. Trump fight so far: immigration. It is true that local police and sheriff’s deputies should not be turned into immigration agents, doing work that properly belongs to the federal government and which would hamper their ability to work effectively with immigrant communities. But neither should the state, in its zeal to resist Trump, throw up obstacles to cooperation that would protect serious criminals from deportation. Early versions of SB 54 — the so-called sanctuary state bill that would spell out how local police agencies should work with Immigration and Customs Enforcement agents — allowed the state to make policing decisions that have traditionally been made locally, could have goaded ICE agents into even more harmful immigration sweeps and, potentially, made it harder to keep violent criminals off the streets.

Many Californians are extremely — and rationally — pessimistic about the next few years under President Trump. But here’s another hard truth: If and when there are opportunities for reasonable collaboration with the new administration, the state must be prepared to take them. California relies on the federal government for $105 billion in aid each year, money it badly needs. Total noncooperation is not an option. Besides, Sacramento and Washington, D.C., have certain mutual interests: If the president wants shovel-ready infrastructure projects to fund, we have plenty.

That means keeping open the lines of communication, as both Gov. Brown and Mayor Eric Garcetti seem eager to do. With luck, Trump will in turn recognize that the state’s big industries — tech, agriculture, entertainment, tourism — are immensely important to the national economy. If California suffers at the hands of Trump’s policies, so will the rest of the nation.

“ California is an integral part of the United States, where it should remain, staying actively engaged. ” Share this quote

The reality is that California cannot go it alone. Let’s stop fantasizing about “Calexit.” As fun as it may be to imagine California taking its giant, job-creating, climate-protecting, immigrant-friendly economy and building its own nation, history suggests that would be neither wise nor feasible. California is an integral part of the United States, where it should remain, staying actively engaged.

In the days ahead, we Californians must stand up to protect our nation and defend our state. We must read, write and protest. Attend meetings and speak out honestly to those in power. We must vote. Not just for president, but for school board as well. Stand up for the rule of law and the democratic process while also opposing the dangerous policies of America’s new leader.

For the next four years, we must cooperate when it is possible, but fight back when it is necessary in the interests of our state and the union to which it belongs.