Can a state prevent someone from buying property and foreclose at will?

Can a state prevent someone from buying property and foreclose at will?

In this past election, one state passed an updated law that disallows certain non residents from buying property.  What was in the law?  What state passed it?   What was the huge change since 2023? What does this mean for buying real estate in certain states? Can a...