it really just depends on the math. the phrase is "marry the house, date the rate". this means if you can afford a home with rates at like 6.5% and it's not gonna break you, then go for it. cuz if worse come worse, if there's ever an opportunity to refinance, you will drop your housing expense.
the house I live in I bought in 2015, and it was only $240K. now this house is worth like 350K-400K.
also, when I bought this house, my mortgage rate was 4.125%. then I refinanced it down to 3% in 2021 (dropped payment about $300).
what I'm getting at is for me, it would actually cost more money to rent a nice 1BR apartment as opposed to mortgage the 5BR house I currently have.
I currently have enough money to pay off my current mortgage today if I chose to (yes, I would deplete the majority of my cash and investments), but I am HYPER focused on having it paid off within 5 years. in 2 years, I get a huge income increase cuz I won't be paying child support anymore, and I will split that excess between this mortgage and increasing my investing.