Beside some psychotics, that decide to hit other people on purpose, for most people hitting is a sign of overwhelming feelings. So first step would be to analyze yourself honestly in that situations, that you feel overwhelmed to find out the reasons.
Is it more psychical stuff, so are you adding self esteem issues into certain behaviors of your niece? A matter of feeling disrespecet, when she shows certain behaviors.
Or is it more about physical issues, so you are getting tired and exhausted to fast, due to a rather fast changing dayplan with a kid, that might decide to do something else every few minutes? Or simply about the sensory issues of the yelling and so on?
As well that there is nothing bad about accepting your limits, but in the opposite that helps you and your kids. Its the people, that denie their limits, that end finally getting overwhelmed by their feelings, and then acting without any control violently against their kids. When you simply accept to be at the border at your limits, and dont try to denie that, that gives you as well the opportunity to simply tell someone about that and say: "Right now, I cant handle her anymore and need a break. Please could you care for here for a certain time, so I can relax again?"