It is not enough to have a booming economy. The rewards for all that hard work must be fairly distributed.

In Illinois, Gov. Bruce Rauner, who made weakening unions the centerpiece of his agenda, lost his bid for re-election, as did many of the candidates he backed for the Legislature. So did Wisconsin Gov. Scott Walker — probably organized labor’s Public Enemy No. 1, along with his anti-union philosophy.

In Michigan, Democrat Gretchen Whitmer won the race for governor, defeating Bill Schuette, a like-minded successor to Gov. Rick Snyder, who signed union-busting right-to-work legislation. In Minnesota, progressives beat Republicans for governor and both Senate seats. In Ohio, strong labor supporter Sherrod Brown won a third term in the U.S. Senate.

In Missouri, Democratic Sen. Claire McCaskill lost to Republican Josh Hawley. But just three months ago, Missouri voters overwhelmingly voted against a right-to-work bill.

Organized labor faces strong headwinds on the national level. The U.S. Supreme Court, which weakened public unions with its Janus v. AFSCME ruling in June, might take up a similar case attacking unions in the private sector or go after such union-friendly rules as payroll check-offs. President Donald Trump is not a supporter of organized labor, and the U.S. Senate remains in Republican hands.

The setbacks for labor in recent years in states such as Wisconsin and Michigan have been profound and will not be reversed overnight. But labor leaders on Wednesday said they see Tuesday’s election results as a step toward rebuilding the rightful image of organized labor as a champion of economic opportunity for working people.

Toward that end, unions must raise their profile, communicate more effectively, build community relations and do a better job of using social media. Only by remaking themselves as a stronger political force can unions forestall future court rulings to limit their reach.

Unions, to be sure, can be guilty of overreach. We understand the inherent conflict of interest when representatives of a public union sit down to negotiate a contract with the very same elected officials they help put in office.

But unions at their best play an essential role in bettering the lives of working people, as millions of Midwestern voters seemed to understand on Tuesday.

The great union-bashing right-to-work crusade — really just a happy-face slogan for efforts to kill unions — has been derailed in Illinois, at least for now.