While Texas is 1 of only 2 states that could even survive as country (the other being California), the United States can't afford for Texas to leave. That's 10% of the country GDP right there, it's hosts largest port in the gulf coast (Houston), it's a large portion of he aerospace industry. NASA, 30% of the country's oil production, 20% of the country's meat production, and along with New York, headquarters most fortune 500 companies.
The US would have to declare war and take it back by force if Texas tried to leave.