Just to add a little of background why it is needed: The Chrome Lightning inspector shows performance graphs and component tree. Component names are equal to what "toString()" method returns. If for example component ConcreteCmp extends BaseCmp - lightning inspector will refer it as BaseCmp, or the top-most component in hierarchy. The graph looks like tons of components of the same type. Difficult to distinguish which one took long to render and which ones are OK.

Question: Is there a way to override the value returned by toString() method?

Maybe tere is some special hidden attribute or javascript way to tell component to identify itself with particular string.

1 Answer 1


The Inspector should be showing the component definition descriptor. Overriding toString won't help you.

For the performance tab, both inheritance and consumption should be showing up.

In your example, you should see

[Concrete Cmp           ]
    [ Base Cmp          ]
       [ Work insde Base]

So both should be showing up so you can see the work required for your entire component.

  • You are right. For declarative it works just fine. My case is a bit trickier i use dynamic creation of component with createComponents method. In addition to that i use another facet then {!v.body}, this could be the reason why inspector tool does not recognize the components.
    – Pavlonator
    Nov 3, 2016 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .