Legally you don't have to. But I think if it were me I'd let them know when your due. I'd like to not have that surprise pop out in a couple of weeks after they've spent time training you.
Illness can happen at any time and people have family emergencies that take them away from their jobs sometimes. Those are obviously not planned.
I have seen what happens when a person is hired, they start showing a couple of weeks later, then in a few months the company is having to run an ad, hire a new person who's trying to find a job to support their own family, then in 6 weeks the new mom comes in and expects their job back, same shift, same benefits, same everything.
The company just hired a new person and they simply can't afford 2 people for the same position. So they give you crappy hours, they make you work the overnight shift or take on accounts no one else will take because they're too hard. They make you miserable so you'll quit.
This happened to my daughter 2 times. One place she was pregnant when she was hired to work the front desk of a hotel. Days, 10am-6pm, M-F, good pay, lots of benefits especially working for a national name, the discounts and freebies were enormous. After she came back they put her working something like midnight to 7am. No child care, no full time benefits or perks, nothing but a paycheck that wasn't as much as before. She had to quit within a few weeks due to having to leave a newborn and her other kids with anyone she could find that would watch them for pennies per hour. No child care benefits if the care provider isn't a licensed child care provider that takes Sooner Care child care pay.
Then she got pregnant after working at a place for a year. Worked 6pm-2am. Had full child care for those hours, had an apartment and vehicle, barely making ends meet with food stamps and child care assistance and low income subsidy on her rent but making it.
After the baby was born they switcher her to part time because they had "filler her position" when she took a leave of absence. She was maybe working 15 hours per week at that point. She had to quit and go back to stripping to keep her apartment and car.
So not telling a prospective employer and giving them an out in case someone else who is equally desirable is just the right thing to do in my opinion.