No law requires you to tell your boss you’ve decided to divorce. Yet, for several reasons, it might be best if you do.
If you have a bad day at work, it’s difficult to avoid it affecting things when you go home. Maybe you lose your temper quicker with your kids, or perhaps you burst into tears when your spouse asks how your day went.
Following that logic, it is inevitable that troubles in your home life, such as a divorce, will affect you at work. Perhaps you will snap at a teammate rather than answer their questions with your usual patience. Maybe you run to the restroom in floods of tears when your colleague asks you what you got up to last night because you remember you had a massive argument with your spouse about custody.
Giving your employer advance warning allows them to prepare and help you
Remember your employer still has a business to run. Informing them you are divorcing gives them time to prepare.
They can put cover in place if you need to take a day off to attend court or because you are too emotional to deal with customers.
They can understand why you are not performing as well as usual rather than just marking you down on your performance review.
They can take extra care with the work they assign you to avoid anything that triggers you. For example, if you are a journalist, your editor will know to give that post about wedding dresses to someone else.
Getting legal help to relieve some of the divorce stresses increases the chance you can still perform at work during this challenging time.