Was Texas formerly part of Mexico

Yes, Texas was formerly a part of Mexico. It was under Mexican rule from 1821 to 1836, when it gained independence and became the Republic of Texas. Texas later joined the United States in 1845 as the 28th state.