What a psychotic thing to say. You drop your friends the moment they get pregnant, having decided in advance, on no evidence, that they are going to behave in a certain unpleasant, stereotyped way?
Be a much better friend.
I had one friend who, after I told her I was pregnant at 40 over a nice one-on-one lunch during which she expressed her congratulations, literally never responded to my attempts to contact her again. I then moved countries for a few years when still on maternity leave and only saw her again when we started working at the same place about twelve years later.
She apologised for going silent, said she'd always assumed I would stay childfree and had found it terribly hard when I switched categories in her head. Because she was in her fifties when I first met her, and had never talked about it, I'd had no idea that she would have loved children, but it had been too late once she found her life partner after two messy short marriages on another continent long before I'd known her.
Similarly, another apparently happily childfree friend whom I'd only known when he was in his fifties, ended up telling me he'd struggled with me getting pregnant at 40 because, again, unbeknownst to anyone who didn't know them at the time, he and his (much older) wife had wanted children, had unsuccessful very early IVF, and had then almost broken up over whether to adopt. This had happened many years before I got to know them and wasn't something they talked about easily.
I also have childfree friends who have never contemplated having a baby, obviously, or thought about it and decided it wasn't for them.
My point is that no one, whether they're a parent or not, is a one-note stereotype, and to behave as if they are is being a very poor friend.
I was really hurt when those two friends went silent on me, but I accepted that they had their reasons, even if I didn't know what they were till later. And I didn't pre-emptively ditch my other friends without children.