It depends on your parenting style. However, it is advisable to be gentle and compassionate when dealing with toddlers who hit. It would be nice if you provide an example instead of punishing them at a young age.