There are two-by-two main factors to consider here: what [you, your competitors] x [want to do (interest and passion), can do (knowledge and capability)]. The goal is to find a combination that can best satisfy your happiness and productivity. There is no right answer, as it is highly individual dependent, e.g. how smart you are and how fast you can learn.
Personally, I just stick to the interests of my collaborators and myself, and let our knowledge serve as natural constraints.
If possible, try to work on subjects that you are really interested in. You will be happier and more productive, and I will be motivated to learn new things. I would prefer you to tell me what you are interested in, and I will try to come up with projects that can fit our interests and backgrounds. I can pull this off (as demonstrated in my publications), and I know it is very uncommon as most other mentors would prefer you to work on their stuff.
There are other factors to consider, like importance or fashion. But these are much less important to me, because they can change, and often very fast, especially in a science/technology field. If you simply pick a hot topic that you are not really interested in, you will lose everything if it becomes not so hot later. By sticking to your passion, you will at least have fun at the end of the day.