Over the course of my career, I found myself having to learn more and more technologies, and trying to pick the winners. In my current position I sometimes build web apps, and sometimes am working on embedded system prototypes. I've been with my current company for 4 years now (a bit of an oddity in web development) and as a result my skill set has gotten wider, but shallower. I often wonder if I'm doing myself a disservice in this.
A few times in my career, I've tried to really narrow down the work that I do. Sometimes it's been in pursuit of avoiding certain annoyances: There was a time when I wanted to work exclusively in the back-end because I was so sick of dealing with CSS issues between IE and other browsers. At other points I've wanted to spend all my time in the front end because I was so excited about dynamic front-end experiences - like when I first did AJAX loading of data with jQuery, or when I started experimenting with Angular and React.
It can be rewarding to be the specialist in the room regarding a technology, or a practice, and be able to contribute meaningfully to the community regarding that technology. For instance, if you deeply know and understand the way that React works, you're in a position to potentially contribute to the code in a way that a casual user can't.
Going narrow on a technology stack can be a double-edged sword though. I spent many days and nights in Prototype before finding that it had been superseded by JQuery. And I spent many years in jQuery before realizing that it was no longer in-vogue, favoring frameworks like React and Angular.
As I mentioned above, in my current job I work all over the place. I've gotten to write Web Applications, low-level C firmware for micro-controllers, skills for the Amazon Echo, C++ for Infotainment applications in vehicles. This was a departure from my previous positions where I was working exclusively on web sites and web apps. I've very much enjoyed the additional opportunities, especially in the realm of embedded work because I enjoy electronics so much. It's also helped with this nagging (but silly) fear that I'm somehow not a "real" developer, because I wasn't writing software in a compiled language*.
Wide but shallow gives you the opportunity to explore ideas and concepts you have in your work environment. This is not available to everyone. I've turned away a number of job opportunities because I was being sought after to work on a company shopping cart, or a shipping technologies. My current job gives me the chance to do a lot of blue-sky exploration. So the more I know, the more likely it is I get to work on something new and interesting.
This of course, also has its downsides. Not being an expert or a "ninja" in a single technology means you might get overlooked when employers are looking for candidates. In my experience working at a job in a particular technology is the best opportunity to go deeper into that technology, because you're otherwise stuck in the position of spending your off-hours time in it. If you don't specialize, you might find yourself switching modes so often that you can't do the deep-dive you want it.
So what's a developer to do? I think many web developers of old became "Full Stack" developers because there was a need at the time. Web developers weren't as plentiful as they are now, and it was a great way to get yourself on someone's radar. That landscape has changed with a flood of new developers into the industry. I have coworkers who are still early in their software development career, and have expressed to me trepidation in spreading their skill set too thin. The best advice I can give to you is: Don't do anything out of fear. Do your best to stay on top of where you're working, and explore your interests.
*This is a form of impostor syndrome, by the way, and it's important to know that many many people feel it, even those of us who have been in our careers for more than a decade.