It's all individual. That's like saying writing only happens when you know exactly the story to tell. I love open a blank project with a vague idea of what I want to do, and then just start exploring while I'm coding.
I mainly use social media when waiting for the bus, on the metro, etc. It's nice to get some updates, but I very rarely share anything so I never fish for likes or compare myself to others. But I'm so happy that I grew up in the 80s-90s, I can't imagine how stressful it would be to have social media as a 12-15 year old...