Several factors are the cause, anticipate them!
The cold, physical effort, fatigue, alcohol, being unfit, insufficient hydration, hypoglycaemia, stress, or even unsuitable equipment... There are many reasons for muscle cramps.
To avoid them, build up slowly with fins suited to your body shape and finning technique.
Use a snorkeling buoy to make things easier for your children. Warm up before you start.
And do some stretching afterwards!
And, as a careful snorkeler, don’t forget to stay close to the shore.
Sufficient food intake is also important before snorkeling. Indeed, hypoglycaemia causes fatigue and especially cramps.