Wheel bearing purchase question

Hi, I was just wondering if you should replace the hub as well when replacing a rear wheel bearing? I’m curious because most parts stores incl. honda only sells it with the hub as well. Do you guys usually only replace the bearing?

I know autozone also only sells the whole hub assembly and not just individual rear bearings. I have never replaced these, but I’d imagine if that’s how its sold then that’s probably best way.