You have a choice. You can be a specialist, or a generalist.
Let's use the Pareto Principle to explain it.
Specialist means your skills are 80% ONE THING, one field. You dedicate 80% of your time to that, and you have no interest in expanding your knowledge outside of it.
You ignore 99% of the rest of the things to be great at that specific 1% you want.
Generalist means you have your hands into 4 different broad topics, and you dedicate 25% of your energy to each of them.
Or maybe your skills are 50% in one field, and you have 2 other fields where you put the other 50% of your time.
You're a specialist if you're a developer focusing on React and you just do that. You even call yourself "React developer".
You're a generalist if you know and use React, but also know Vue, you can design a page in Figma and translate that design into a React component with CSS. Plus, you also know how to deploy an application to Heroku.
Which is better?
I don't know.
Some companies only hire specialists. If you're Google, it makes little sense to hire a generalist, I think. They have entire teams doing that very specific thing.
An early-stage startup might hire a few generalists instead, because they are more flexible and ready to change their focus at need.
I am a generalist. I am a Computer Engineer that can write in a few different programming languages, I have an eye for design, I can do some design, copywriting and marketing, I know how to use a Linux server, I can create mobile apps, Web apps, I work with embedded devices.
And I do all those things pretty poorly, if you compare the result of each individual thing I might do with the outcome of a specialist.
But as a generalist I have an advantage over a specialist: I will never say "this is not something I do".