Electrolytes for Performance

Which electrolytes are useful (critical?) to maintain performance. I noticed most sports powders have a good dose of sodium at 300-400mg and Potassium but half have magnesium and half don’t. Is magnesium useful or necessary as part of an intra training electrolyte beverage?

I do not think supplementing with electrolytes intraworkout are useful for resistance training. Pre and post workout, I think that having sodium added to meals (and potentially liquids) may be useful in the context of total daily sodium intake. I don’t think people should be supplementing potassium or magnesium at all.