"The three companies, now also joined by Instacart and Postmates, funded a ballot initiative, Proposition 22, to exempt both ridesharing and delivery companies from the AB 5 requirements, while also giving drivers some new protections, including minimum wage and per-mile expense reimbursement. Proposition 22 passed in November 2020 with 59% of the vote.[8][9]"
From: https://en.wikipedia.org/wiki/California_Assembly_Bill_5_(20...
So the law has an exemption for the exact workers it was targeting.