Was Mexico part of Texas?

Yes, but Texas was part of Mexico.