The defining economic trend of the 21st century has been the rise of the gig economy often at the expense of traditional employment.

Those working in the gig economy, 57 million people according to recent estimates, perform a range of activities from babysitting, delivering food, ghostwriting to driving on rideshare apps such as Uber and Lyft.

This ad-hoc employment not only provides an extra source of income for individuals looking to make ends meet but it also allows people to earn an additional income around existing commitments such as childcare, family or other jobs.

As the size of the gig economy has grown, so too have the efforts of state governments to restrict its existence.

The recent passage of Assembly Bill 5 in California, however, provides a crystal ball that reveals the real economic damage that crackdowns on the gig economy can cause for both employers and employees.

Ignoring the damage AB-5 has caused in California, legislators in New York, New Jersey and Illinois have followed suit and proposed measures that would further imperil the gig economy.

California’s recent passage of AB-5 should serve as a warning to states across the country about the dangers of state intervention in the economy.

AB-5 forced California employers to reclassify their gig workers as traditional employees. Specifically, AB-5 dictates employers must demonstrate that the gig worker is “free from the control and direction of the hiring entity in the performance of the work,” and that the worker performed work “that is outside the usual course of the hiring entities business.”

Finally, employers need to demonstrate the worker “is not customarily engaged in an independently established trade, occupation or business of the same nature as the work performed by the hiring entity.” Only after these criteria are met can a company classify somebody as a gig worker.

Recognizing the onerous regulations AB-5 imposed on California’s businesses, the state’s Chamber of Commerce warned the legislation would be “detrimental to millions of Californians” and would “eliminate the vast majority of independent contractors in California,” preventing the state’s workforce from earning extra income and prevent small businesses from accessing the labor needed to grow.

These are not some lightweight warnings.

One of the critiques against the use of gig work, and of the misguided justifications for AB-5, is that it is exploitative. But as a recent survey by the Bureau of Labor Statistics found, “independent contractors overwhelmingly favored their employment arrangement … to a traditional one” by 79 percent in favor as opposed to 9 percent who favor traditional employment.

The significant popularity of gig work compared to traditional employment indicates individuals who participate in the gig economy do so consensually, contrary to the charges of exploitation. By limiting the ability of people to participate in the gig economy, states such as California are preventing their residents from freely exchanging their labor to earn additional income.

Restricting the gig economy also poses significant problems for small businesses, many of whom cannot afford the extra costs of hiring employees.

The Massachusetts Institute for Technology estimated it costs 1.25 times the base salary of an employee to “cover employment taxes and benefits.” While large companies can pay for benefits, payroll taxes and other employee-related expenses, small businesses, that employ more than 7 million Californians and account for 99 percent of California businesses are unlikely to initially be in a position to meet these costs, preventing them from hiring the labor needed to grow.

Unfortunately, the effects of AB-5 are not abstract, but they have had very real consequences for California’s workforce with many companies being forced to end relationships with gig workers.

The sports blog SB Nation, for example, was recently forced to lay off most of its freelance writers in California because AB-5 made it impossible for them to be profitable. Uber also warned that by restricting gig workers, 158,000 people could lose their jobs.

By forcing businesses to classify gig workers as traditional employees, AB-5 has caused many workers to lose additional income, restricting their economic opportunities and damaging their economic opportunities. The warning from Uber further suggests that even large companies are not immune to the harm of AB-5.

Recognizing the very real damage AB-5 is causing to California’s economy, especially in terms of jobs lost and increased costs for small businesses, other states should be wary about limiting access to gig workers.

Not only has it limited the ability of companies to employ the labor needed to grow, but it has prevented many Californians from accessing extra streams of income and lowering their economic opportunities.