In recent years, companies like Uber and Lyft have provided workers a new opportunity to make a buck on their own schedules, choosing when to work and when not to work. Some drivers choose to work at “surge” times, when demand is high, to make more money. This kind of flexible work has created the gig economy — a burgeoning sector that employs 24 percent of adults.

But on Tuesday, California’s State Senate passed a bill that threatens to destroy all that. Assembly Bill 5 (A.B.5) would require companies like Uber, Lyft, DoorDash, and more to treat contractors like employees. This would involve offering benefits like sick and vacation days, health insurance, and other “protections” under the Fair Labor Standards Act, Americans with Disabilities Act, or the Civil Rights Act. Minimum wage, overtime pay, and unemployment insurance would also be involved.

All this can add 30 percent to labor costs, hitting gig employers hard. Yet all this also undermines the basic idea of the gig economy, by trying to pigeonhole flexible gig workers into the traditional employee mold — with set hours, company equipment, and a company workspace.

This way of approaching work undermines the very genius of the gig economy. Uber and Lyft work so well because contract workers use their own cars, saving the companies tremendous up-front costs. Workers can choose whether or not to work and for how long, using gigs to supplement their income to pay the bills if their 9-5 jobs don’t cut it.

Workers want the options presented by the gig economy, and customers appreciate the lower costs associated with the scrappy dealings of companies like Uber.

But from a certain mindset, this opportunity looks like exploitation. Especially with liberals championing unions, many want to close down the gig economy in the name of workers’ rights.

This mentality helps explain why the California State Assembly passed A.B. 5 in May, and why the State Senate passed it on Tuesday. Gov. Gavin Newsom, a Democrat, has pledged to sign A.B. 5. It seems Uber and Lyft have lobbied against the bill to no avail.

This bill does not just threaten the burgeoning gig economy, however. Other economic sectors could also face serious challenges, from health care to trucking, the San Francisco Chronicle‘s Carolyn Said reported.

In the health care sector, doctors, dentists, psychologists, and podiatrists are exempt from A.B. 5, but many other medical professionals — like behavioral therapists and optometrists — are not. Hospitals rely on independent contractors to fill gaps when employees are on leave. These contractors, like gig economy workers, value their independence and autonomy.

Newspapers and other media outlets also use independent contractors to deliver papers to homes and businesses. New language was added to the bill exempting freelance writers and photojournalists from the rules, but only if they send in 35 or fewer submissions to a single publication in a single year. Requiring papers to hire delivery workers as employees could add 30 percent to labor costs, further weakening the viability of local newspapers.

Many of California’s 70,000 truck drivers own their own rigs in order to work independently. Some truck drivers may move to Nevada, Oregon, or other states to retain their independence. A.B. 5 has a narrow exemption for some truck owner-operators who work with construction companies that are registered as public works contractors, but leaders in the trucking industry say this won’t curtail most of the harm the bill poses.

Ironically, the bill may also hit franchisers who operate as small business owners. California has 76,000 franchise businesses, and an expert warned that A.B. 5 “would essentially convert these business owners into employees overnight.” Anyone who owns a McDonald’s or other franchise would become an employee of McDonald’s, and so would all their workers. This would require enormous restructuring across various sectors of the economy.

Language translators, youth sports coaches, and some nonprofits have sought exemptions or registered objections to A.B. 5. Said’s article also noted that independent musicians, who hire engineers, dancers, background vocalists, and other contract workers, may have to formally employ them under the bill when it becomes law.

Liberals have hailed the bill as an opportunity to give many workers “basic labor rights for the first time,” but people do not join Uber or Lyft as contract drivers in pursuit of a 9-5 day job. Organized labor and government-mandated benefits are Kryptonite to the gig economy — and many more contractors.

A.B. 5 will have disastrous effects on California’s economy, and Americans should take heed. Nationalizing this kind of law could reverse a great deal of the economic progress of the last few decades.

Follow Tyler O’Neil, the author of this article, on Twitter at @Tyler2ONeil.