Custom component class names warning

Custom component class names warning
0.0 0


Hello there :slight_smile:

I’ve specified custom name for my Target component class

export default class Target extends cc.Component {


This way my component classes are organized in sub-menus under ‘Add Custom Component’ drop-down. Otherwise it would be unmanagebly huge flat list with hundreds of elements.

But Cocos Creator (at least 1.9.2, don’t think that version is relevant though) shows warnings like this:

Should not specify class name Gameplay/Target for Component which defines in project.

Why? What is the downside of this approach and what is an alternative to organize components menu?

Thanks for the answer.


Use @menu(“Gameplay/Target”)


Awesome! Thanks. Will dig into that cc._decorator for other useful stuff :slight_smile: