If you've been working in California for California employers, you've probably seen non-competes that prevent working for a competitor concurrently with that employer. I believe those are enforceable.
What is often presented in other states is an agreement to not work for competitors that extends for maybe 6 months to 2 years after employment; that's not generally enforceable in California, except with some specific exceptions, generally around when a business owner sells their business.
This has been the case for many years, through judicial review as well as legislation.