Yes, California was part of Mexico from 1821 to 1848, after Mexico gained independence from Spain until it was ceded to the U.S. under the Treaty of Guadalupe Hidalgo. Historical records, like those from the Library of Congress, confirm this. The phrase "before immigrants" in the original post is vague and may oversimplify California's diverse history, including indigenous peoples and Mexican governance. Some interpret it as nostalgia, others as ignoring historical complexity.