This claim is a little more difficult to give a specific yes or no to considering that it is not proven to be the exact main cause for al mental illnesses. In the article given National Library of Medicine it shows much more of the data aspect of it all, and gives clear numbers to help calculate the study. In a different article HelpGuide.org it talks more about the affects of mental health and the pros and cons, a direct quote from the passage is "multiple studies have found a strong link between heavy social media and increased risk for depression, anxiety, loneliness, self-harm, and even suicidal thoughts".
So while neither of these articles give a precise yes or no they share how it could be a leading cause to possible mental illnesses.