Heartburn 39+5

kay
I thought heartburn was meant to go later I'm pregnancy? I didn't have it at all apart from a couple of works and that was at about 30 weeks. I'm nearly 40 weeks and it's come back. Ahhh .Anyone like this and know why it comes back right right at the end?